public class XMLSocketSimulationAgent extends AbstractSimulationAgent implements Component, SocketHandler, UniqueSimulationAgent
Modifier and Type | Field and Description |
---|---|
String |
metainfoNamespace
Namespace for all administrative elements and attributes.
|
String |
metainfoPrefix
Namespace prefix for all administrative elements and attributes.
|
Constructor and Description |
---|
XMLSocketSimulationAgent()
Construct a new XMLSocketSimulationAgent that will try to generate action of a certain class.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Map<String,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.
|
Socket |
getCurrentSocket() |
long |
getDisconnectTimeOut()
Retrieve maximum time to use when disconnecting to send messages that are still in the queue.
|
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(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(Map<String,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(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.
|
concurrentGetAction
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
concurrentGetAction
public final String metainfoNamespace
public final String metainfoPrefix
public XMLSocketSimulationAgent()
account
- actionClass
- public Object getIdentifier()
getIdentifier
in interface UniqueSimulationAgent
public void setIdentifier(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 Map<String,Class> getActionClassMap()
public void setActionClassMap(Map<String,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 perceptionpublic void remove()
SimulationAgent
remove
in interface SimulationAgent
public void handleSocket(Socket s)
handleSocket
in interface SocketHandler
public Socket getCurrentSocket()
public void start()
Component
Copyright © 2013. All Rights Reserved.