visidia.simulation.process
Class AgentProcess

java.lang.Object
  extended by visidia.simulation.process.ProcessType
      extended by visidia.simulation.process.AgentProcess

public class AgentProcess
extends ProcessType

This class represents a communication process based on mobile agents.


Field Summary
 
Fields inherited from class visidia.simulation.process.ProcessType
id, server
 
Constructor Summary
AgentProcess(Server server, Vertex vertex, int id)
          Instantiates a new agent process.
 
Method Summary
 void deadAgent()
          Dead agent.
 Agent getAgent()
          Gets the agent.
 Vertex getDestinationVertex()
          Gets the destination vertex.
 Vertex getOriginVertex()
          Gets the origin vertex.
 void moveAgentTo(Agent ag, int door)
          Moves an Agent to a specified door.
 void setAgent(Agent agent)
          Sets the agent.
 void setDestinationVertex(Vertex destination)
          Sets the destination vertex.
 void setOriginVertex(Vertex origin)
          Sets the origin vertex.
 void sleep(Agent ag, int milliseconds)
          Makes the specified agent fall asleep for a given amount of milliseconds.
 
Methods inherited from class visidia.simulation.process.ProcessType
changeEdgeState, getEdgeProperty, getId, getServer, runningControl, setEdgeProperty, setEdgeProperty, setThread, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentProcess

public AgentProcess(Server server,
                    Vertex vertex,
                    int id)
Instantiates a new agent process.

Parameters:
server - the server
vertex - the vertex
id - the id
Method Detail

getAgent

public Agent getAgent()
Gets the agent.

Returns:
the agent

setAgent

public void setAgent(Agent agent)
Sets the agent.

Parameters:
agent - the new agent

getOriginVertex

public Vertex getOriginVertex()
Gets the origin vertex.

Returns:
the origin vertex

getDestinationVertex

public Vertex getDestinationVertex()
Gets the destination vertex.

Returns:
the destination vertex

setOriginVertex

public void setOriginVertex(Vertex origin)
Sets the origin vertex.

Parameters:
origin - the new origin vertex

setDestinationVertex

public void setDestinationVertex(Vertex destination)
Sets the destination vertex.

Parameters:
destination - the new destination vertex

deadAgent

public void deadAgent()
               throws java.lang.InterruptedException
Dead agent.

Throws:
java.lang.InterruptedException - the interrupted exception

moveAgentTo

public void moveAgentTo(Agent ag,
                        int door)
                 throws java.lang.InterruptedException
Moves an Agent to a specified door.

Parameters:
ag - the Agent you want to move
door - the door to which you want to move the Agent
Throws:
java.lang.InterruptedException - the interrupted exception

sleep

public void sleep(Agent ag,
                  int milliseconds)
           throws java.lang.InterruptedException
Makes the specified agent fall asleep for a given amount of milliseconds.

Parameters:
ag - Agent given to fall asleep
milliseconds - the milliseconds
Throws:
java.lang.InterruptedException