public final class AtomTypeAgentManager<E>
extends java.lang.Object
This class should only be used instead of a Map when the SimulationListener functionality is
required. That is, when the map needs to be kept up-to-date with every AtomType and an object provided by the
AgentSource.
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
AtomTypeAgentManager.AgentSource<E> |
Interface for an object that wants an agent associated with each AtomType in a Simulation.
|
| Modifier and Type | Field | Description |
|---|---|---|
protected Simulation |
sim |
| Constructor | Description |
|---|---|
AtomTypeAgentManager(AtomTypeAgentManager.AgentSource<E> source,
Simulation sim) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
dispose() |
Releases its agents.
|
E |
getAgent(AtomType type) |
Convenience method to return the agent the given AtomType.
|
IndexMap<E> |
getAgents() |
|
void |
setAgent(AtomType atomType,
E newAgent) |
Sets the agent associated with the given atom type to be the given agent.
|
protected Simulation sim
public AtomTypeAgentManager(AtomTypeAgentManager.AgentSource<E> source, Simulation sim)
public void setAgent(AtomType atomType, E newAgent)
public E getAgent(AtomType type)
public void dispose()