|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmassim.framework.AbstractSimulationAgent
massim.framework.connection.XMLSocketSimulationAgent
public class XMLSocketSimulationAgent
This class manages the communication to an agent, offering methods that will make it possible to treat instances of this object as a simulation agent. This special class uses XML to communicate with an agent.
Field Summary | |
---|---|
java.lang.String |
metainfoNamespace
Namespace for all administrative elements and attributes. |
java.lang.String |
metainfoPrefix
Namespace prefix for all administrative elements and attributes. |
Constructor Summary | |
---|---|
XMLSocketSimulationAgent()
Construct a new XMLSocketSimulationAgent that will try to generate action of a certain class. |
Method Summary | |
---|---|
void |
configurePingPerTimeFrameLimit(long pings,
long timeframe)
Configure ping per timeframe limit |
Action |
getAction(Perception perception)
Ask the agent to act, based a new perception p aswell as other previously received perceptions in that run. |
java.util.Map<java.lang.String,java.lang.Class> |
getActionClassMap()
Return current action class. |
long |
getAuxiliaryTimeout()
Retrieve the maximum auxiliary time that is granted to an agent to process a perception and answer with an action. |
java.net.Socket |
getCurrentSocket()
|
long |
getDisconnectTimeOut()
Retrieve maximum time to use when disconnecting to send messages that are still in the queue. |
java.lang.Object |
getIdentifier()
|
long |
getMaximumPacketLength()
Retrieve maximum packet length allowed to receive. |
long |
getPingMaximum()
Return maximum number of pings. |
long |
getTimeout()
Retrieve the maximum major time that is granted to an agent to process a perception and answer with an action. |
XMLCodec.XMLToObjectConverter |
getXmlToObjectConverter()
|
void |
handleSocket(java.net.Socket s)
|
boolean |
isPingAllowed()
Return true iff ping is enabled. |
void |
remove()
Tell an agent that it was removed from the simulation and will never act again. |
void |
setActionClassMap(java.util.Map<java.lang.String,java.lang.Class> actionclassmap)
Set action class. |
void |
setAuxiliaryTimeout(long auxiliaryTimeOut)
Set the maximum auxiliary time that is granted to an agent to process a perception and answer with an action. |
void |
setDisconnectTimeOut(long t)
Set maximum time to use when disconnecting to send messages that are still in the queue |
void |
setIdentifier(java.lang.Object identifier)
Set identifier for this object |
void |
setMaximumPacketLength(int maximumPacketLength)
Set maximum packet length allowed to receive. |
void |
setPingAllowed(boolean ping)
Enable/disable ping. |
void |
setPingMaximum(long maxping)
Set maximum number of pings. |
void |
setPingPerTimeFrameEnabled(boolean v)
Activate/Deactivate ping per timeframe limit |
void |
setTimeout(long timeOut)
Set the maximum major time that is granted to an agent to process a perception and answer with an action. |
void |
setXmlToObjectConverter(XMLCodec.XMLToObjectConverter xmlToObjectConverter)
|
void |
start()
Tell the component to start activity. |
void |
stop()
Tell the component to cease activity. |
Methods inherited from class massim.framework.AbstractSimulationAgent |
---|
concurrentGetAction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface massim.framework.SimulationAgent |
---|
concurrentGetAction |
Field Detail |
---|
public final java.lang.String metainfoNamespace
public final java.lang.String metainfoPrefix
Constructor Detail |
---|
public XMLSocketSimulationAgent()
account
- actionClass
- Method Detail |
---|
public java.lang.Object getIdentifier()
getIdentifier
in interface UniqueSimulationAgent
public void setIdentifier(java.lang.Object identifier)
public long getTimeout()
timeOut
- timeout in millisecondspublic void setTimeout(long timeOut)
timeOut
- timeout in millisecondspublic long getAuxiliaryTimeout()
timeOut
- timeout in millisecondspublic void setAuxiliaryTimeout(long auxiliaryTimeOut)
timeOut
- timeout in millisecondspublic void setMaximumPacketLength(int maximumPacketLength)
maximumPacketLength
- maximum packet length in bytespublic long getMaximumPacketLength()
public void setPingAllowed(boolean ping)
ping
- true iff ping should be enabledpublic boolean isPingAllowed()
public long getPingMaximum()
public void setPingMaximum(long maxping)
public java.util.Map<java.lang.String,java.lang.Class> getActionClassMap()
public void setActionClassMap(java.util.Map<java.lang.String,java.lang.Class> actionclassmap)
actionclass
- action to generate.public XMLCodec.XMLToObjectConverter getXmlToObjectConverter()
public void setXmlToObjectConverter(XMLCodec.XMLToObjectConverter xmlToObjectConverter)
xmlToObjectConverter
- The xmlToObjectConverter to set.public void configurePingPerTimeFrameLimit(long pings, long timeframe)
public void setPingPerTimeFrameEnabled(boolean v)
public long getDisconnectTimeOut()
public void setDisconnectTimeOut(long t)
t
- new maximum disconnect timepublic Action getAction(Perception perception)
SimulationAgent
getAction
in interface SimulationAgent
perception
- new perception
public void remove()
SimulationAgent
remove
in interface SimulationAgent
public void handleSocket(java.net.Socket s)
handleSocket
in interface SocketHandler
public java.net.Socket getCurrentSocket()
public void start()
Component
start
in interface Component
public void stop()
Component
stop
in interface Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |