agentland.resource.connect
Class ConnectionMakerAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.resource.connect.ConnectionMakerAgent

public class ConnectionMakerAgent
extends GoodAgent
implements ConnectionMaker

Connect things together -- lots stolen from the old drug Pipeline agent.

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  SQLGraph graph
           
 
Fields inherited from class agentland.util.GoodAgent
alert, notifier
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
ConnectionMakerAgent()
           
 
Method Summary
 void addEdge(AgentID from, String outPort, AgentID to, String inPort)
           
 void addEdge(String from, String outPort, String to, String inPort)
           
 int connect(AgentID from, AgentID to)
          Connect "from" to "to".
protected  boolean connect(String in, String agtIDstr, String out)
          Call given agent and tell it to connect in and out.
 boolean connectable(AgentID start, AgentID stop)
          tells you whether there exists a connection between a pair of drugs
protected  void connectPath(Path p)
          Given a path, this method calls all intermediate agents and sets their inputs and outputs in such a way that the path is connected
 void disconnect(int id)
          kills (resets to 0 cost) the connection with a given id.
 
Methods inherited from class agentland.util.GoodAgent
addSpy, addSpy, alert, alertString, beep, error, getAlert, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell
 
Methods inherited from class metaglue.AgentAgent
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

graph

protected SQLGraph graph
Constructor Detail

ConnectionMakerAgent

public ConnectionMakerAgent()
                     throws RemoteException
Method Detail

connect

public int connect(AgentID from,
                   AgentID to)
Connect "from" to "to". Will look for cheapest path.
Specified by:
connect in interface ConnectionMaker
Returns:
id for connection so it can be released. Use this id on any further calls. If connection cannot be made, returns -1.

connect

protected boolean connect(String in,
                          String agtIDstr,
                          String out)
Call given agent and tell it to connect in and out.

connectPath

protected void connectPath(Path p)
Given a path, this method calls all intermediate agents and sets their inputs and outputs in such a way that the path is connected

disconnect

public void disconnect(int id)
                throws RemoteException
kills (resets to 0 cost) the connection with a given id.
Specified by:
disconnect in interface ConnectionMaker

connectable

public boolean connectable(AgentID start,
                           AgentID stop)
                    throws RemoteException
tells you whether there exists a connection between a pair of drugs
Specified by:
connectable in interface ConnectionMaker

addEdge

public void addEdge(String from,
                    String outPort,
                    String to,
                    String inPort)
Specified by:
addEdge in interface ConnectionMaker

addEdge

public void addEdge(AgentID from,
                    String outPort,
                    AgentID to,
                    String inPort)
Specified by:
addEdge in interface ConnectionMaker