public class GridConnected<A extends Agent<?>,L extends Link> extends java.lang.Object implements Connector<A>
The size of the grid, if not indicated, is inferred thanks to the number of agents in the group.
There are 2 sub-strategies used to define the neighborhood of each agent, "MooreNeighborhood" and "VonNeumannNeighborhood", that can be triggered respectively by mooreConnected and VonNeumannNeighborhood. - mooreConnected : use the moore neighborhood for the grid - vonNeumannConnected(n: Int) : use the Von Neumann neighborhood for the grid ; n is the maximal Manhattan distance between neighbors.
Constructor and Description |
---|
GridConnected(java.lang.Class<L> linkClass,
SerializableBiConsumer<A,L> dataInjector) |
Modifier and Type | Method and Description |
---|---|
void |
connectAgent(A agent,
GroupInformation sourceInfo,
GroupInformation targetInfo)
The method that creates links between the agent whose `agentInit` is in charge of.
|
GridConnected<A,L> |
mooreConnected() |
GridConnected<A,L> |
mooreConnected(int n) |
GridConnected<A,L> |
vonNeumannConnected() |
GridConnected<A,L> |
vonNeumannConnected(int n) |
GridConnected<A,L> |
width(long l) |
GridConnected<A,L> |
wrapped() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createLink, createLinks
public GridConnected(java.lang.Class<L> linkClass, SerializableBiConsumer<A,L> dataInjector)
public GridConnected<A,L> wrapped()
public GridConnected<A,L> width(long l)
public GridConnected<A,L> mooreConnected()
public GridConnected<A,L> mooreConnected(int n)
public GridConnected<A,L> vonNeumannConnected()
public GridConnected<A,L> vonNeumannConnected(int n)
public void connectAgent(A agent, GroupInformation sourceInfo, GroupInformation targetInfo)
Connector
connectAgent
in interface Connector<A extends Agent<?>>
agent
- : the agent to be connected. Links are to be added directly to this agent.sourceInfo
- : information of the source grouptargetInfo
- : information of the target group