Package org.baseagent.comms
Class NearestNeighborCommunicator
java.lang.Object
org.baseagent.sim.SimulationComponent
org.baseagent.comms.Communicator
org.baseagent.comms.NearestNeighborCommunicator
- All Implemented Interfaces:
SimulationListener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.baseagent.sim.SimulationComponent
SimulationComponent.Type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindNearestNeighbors
(HasGridPosition fromAgent) This calculates the distance between agents based on each agent's knowledge of its location.getExpectedRecipients
(Message message) Methods inherited from class org.baseagent.comms.Communicator
getType, sendDirectedMessage, sendMessage
Methods inherited from class org.baseagent.sim.SimulationComponent
getSimulation, getUUID, setSimulation
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.baseagent.sim.SimulationListener
onAfterStepEnded, onAfterStepStarted, onBeforeStepEnded, onBeforeStepStarted, onSimulationComponentAdded, onSimulationComponentRemoved, onSimulationEnded, onSimulationPaused, onSimulationResumed, onSimulationStarted, onSimulationStopped, onStepEnded, onStepStarted
-
Constructor Details
-
NearestNeighborCommunicator
-
-
Method Details
-
getExpectedRecipients
- Specified by:
getExpectedRecipients
in classCommunicator
-
findNearestNeighbors
This calculates the distance between agents based on each agent's knowledge of its location. Instead, you might want to calculate the distance based on what each agent *THINKS* its distance is from other agents. That will require that the calculation uses the fromAgent's internal knowledge rather than the agent data from the simulation.- Parameters:
fromAgent
-- Returns:
-