CSC 435 Program Four A Intelligent Distributed Agent Part One—HostServer solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (9 votes)

HostServer Instructions:
This assignment is straightforward: run the HostServer. Comment it. Submit it.
Here is the HostServer code.
Download the code, compile it, run it:
javac HostServer.java
java HostServer
Follow the instructions in the program console and on the web page to spawn new agents and make them migrate.
You will connect from your Firefox browser (or other?) at http://localhost:4242
View the source of the web page that pops up to understand how this works.
Read about the details of the program in the web page below, and in the PowerPoint lecture.
Add your comments to the code.
Submit to D2L.
Nameserver link, for fun. Keeps track of the current location, and group, of each full Distributed Intelligent Agent.
Thanks John Reagan for updates to the code.
Full DIA Instructions:
Links are here for the full DIAgent Program assignment.
Download the java file for the Host Server and compile it. Run the server. Connect to the server from your FireFox (or other) browser at http://localhost:4242. Repeat for two or three clients, running concurrently. Follow the instructions posted on the browser, by the server, to update the state of the various conversations. Cause some of the agents to migrate to different ports. Refer to the execution instructions for the Hostserver if needed. VIEW THE SOURCE of the web pages to understand how the agents migrate.
Thanks also to James Raitsev that has a version with very excellent comments at HostServer.java Raitsev though this code may not work with all browsers.

Here is the text version of the Execution Instructions for the HostServer. The client is simply a web browser pointed to localhost:4242 to start. (Yes, the DIA port may be different.) Here is code to get next available port
Add your own comments to this pedagogical code (required!), to show that you understand how it works.
The HostServer uses a simple counter to get new ports for agents. But code is provided to have the system find the next available port. Consider rewriting your HostServer code to integrate the more graceful code for getting new agent ports. But, this is not required.
Submit HostServer.java WITH YOUR COMMENTS to D2L.
There is no checklist for this “get it running with comments” assignment.
Note: In this HostServer preliminary assignment, because we initiate migration from the web client, we can migrate the agent, capture the new address of the agent, install this in our dynamic HTML and send it back to the client all as part of the one request-response step. In this way the client always knows how to reach the migrated agent.
In the larger assignment, the agent would migrate autonomously, and the client will not know where it has gone. Thus we must leave behind a zombie, to point to the new location when the client connects, or must maintain a NameServer that clients connect to, which then contacts the agent at its currently location, or …[fill in your own solution].

Note: In this HostServer preliminary assignment, to keep things simple, the agents all run under the single HostServer. In the larger assignment we would use multiple HostServer hosts (possibly running on different machines at different IP addresses). However the code is virtually all the same. One will simply have to replace the hard-coded address and port of the current HostServer with some other HostServer IP address and port, and everything else is handled by the current code.