visidia.simulation.process
Class ProcessType

java.lang.Object
  extended by visidia.simulation.process.ProcessType
Direct Known Subclasses:
AgentProcess, MessageProcess

public abstract class ProcessType
extends java.lang.Object

This class represents a calculation entity (called a process) in visidia. A process run following specific communication types. For simplicity, we refer to types of processes instead of types of communication used by processes. ProcessType is the abstract base class for all these types.


Field Summary
protected  int id
          The process id.
protected  Server server
          The server.
 
Constructor Summary
protected ProcessType(int id, Server server)
          Instantiates a new process type.
 
Method Summary
 void changeEdgeState(Vertex vertex, int door, EdgeState newEdgeState)
          Changes the edge state.
 java.lang.Object getEdgeProperty(Vertex vertex, int door, java.lang.Object key)
          Gets the edge property.
 int getId()
          Gets the id.
 Server getServer()
          Gets the server.
 void runningControl()
          Running control.
 void setEdgeProperty(Vertex vertex, int door, java.lang.Object key, java.lang.Object value)
          Sets the edge property.
 void setEdgeProperty(Vertex vertex, int door, java.lang.Object key, java.lang.Object value, boolean displayable)
          Sets the edge property.
 void setThread(java.lang.Thread thread)
          Sets the thread.
 void start()
          Starts the process.
 void stop()
          Stops the process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id
The process id.


server

protected Server server
The server.

Constructor Detail

ProcessType

protected ProcessType(int id,
                      Server server)
Instantiates a new process type.

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

setThread

public void setThread(java.lang.Thread thread)
Sets the thread.

Parameters:
thread - the new thread

getId

public int getId()
Gets the id.

Returns:
the id

getServer

public Server getServer()
Gets the server.

Returns:
the server

runningControl

public void runningControl()
Running control.


start

public void start()
Starts the process.


stop

public void stop()
Stops the process.


changeEdgeState

public void changeEdgeState(Vertex vertex,
                            int door,
                            EdgeState newEdgeState)
                     throws java.lang.InterruptedException
Changes the edge state.

Parameters:
vertex - the vertex
door - the door
newEdgeState - the new edge state
Throws:
java.lang.InterruptedException - the interrupted exception

getEdgeProperty

public java.lang.Object getEdgeProperty(Vertex vertex,
                                        int door,
                                        java.lang.Object key)
Gets the edge property.

Parameters:
vertex - the vertex
door - the door
key - the key
Returns:
the edge property value

setEdgeProperty

public void setEdgeProperty(Vertex vertex,
                            int door,
                            java.lang.Object key,
                            java.lang.Object value,
                            boolean displayable)
Sets the edge property.

Parameters:
vertex - the vertex
door - the door
key - the key
value - the value
displayable - indicates if the property can be viewed on graph

setEdgeProperty

public void setEdgeProperty(Vertex vertex,
                            int door,
                            java.lang.Object key,
                            java.lang.Object value)
Sets the edge property.

Parameters:
vertex - the vertex
door - the door
key - the key
value - the value