public interface AgentSystem<S extends GlobalState> extends JSONValue
| Modifier and Type | Method and Description |
|---|---|
void |
beginStep()
reset all the accumulator that haven't been flagged as persistent
|
static AgentSystem<GlobalState> |
create(Model model) |
static <S extends GlobalState> |
create(S globalState,
Model model) |
default DoubleAccumulator |
createDoubleAccumulator(java.lang.String name)
createDoubleAccumulator(String, String) using the name for reporting
purposes. |
default DoubleAccumulator |
createDoubleAccumulator(java.lang.String name,
java.lang.String displayName)
Create a
DoubleAccumulator. |
default LongAccumulator |
createLongAccumulator(java.lang.String name)
createLongAccumulator(String, String) using the name for reporting
purposes. |
default LongAccumulator |
createLongAccumulator(java.lang.String name,
java.lang.String displayName)
Create a
LongAccumulator. |
void |
done() |
default <T extends Agent<S>> |
generateGroup(java.lang.Class<T> agentClass,
long size)
generateGroup(Class, long, SerializableConsumer) without a data injector so
no initial function is run for agents |
<T extends Agent<S>> |
generateGroup(java.lang.Class<T> agentClass,
long size,
SerializableConsumer<T> dataInjector)
Create a
Group of agents. |
Graph<S> |
getBackendGraph() |
Configuration |
getConfig() |
ModelContext |
getContext() |
DoubleAccumulator |
getDoubleAccumulator(java.lang.String name) |
java.util.Map<java.lang.String,DoubleAccumulator> |
getDoubleAccumulators() |
S |
getGlobals() |
LongAccumulator |
getLongAccumulator(java.lang.String name) |
java.util.Map<java.lang.String,LongAccumulator> |
getLongAccumulators() |
Model |
getModel() |
default <T extends Agent<S>> |
loadGroup(java.lang.Class<T> clazz,
Source source)
loadGroup(Class, Source, SerializableConsumer) without a data injector so
no initial function is run for agents |
<T extends Agent<S>> |
loadGroup(java.lang.Class<T> agentClass,
Source source,
SerializableConsumer<T> dataInjector)
|
void |
registerAgentTypes(java.lang.Class<? extends Vertex<S>>... type) |
void |
registerLinkTypes(java.lang.Class<? extends Link>... types) |
void |
registerMessageTypes(java.lang.Class<? extends Message>... types) |
<T extends Agent<S>> |
select(java.lang.Class<T> agentType)
Select all agents of a given type from the system.
|
<T extends Agent<S>> |
selectRandomAgent(java.lang.Class<T> agentType)
Select one random agent
|
<T extends Agent<S>> |
selectRandomAgents(java.lang.Class<T> agentType,
int n)
Select N random agents
|
void |
setup() |
<T extends Agent<S>> |
stats(java.lang.Class<T> agentType)
Select all agents of a given type from the system, for summarization through
AgentStatistics. |
getSchema, getValues, receiveJSONstatic <S extends GlobalState> AgentSystem<S> create(S globalState, Model model)
static AgentSystem<GlobalState> create(Model model)
default <T extends Agent<S>> Group<T> generateGroup(java.lang.Class<T> agentClass, long size)
generateGroup(Class, long, SerializableConsumer) without a data injector so
no initial function is run for agents<T extends Agent<S>> Group<T> generateGroup(java.lang.Class<T> agentClass, long size, SerializableConsumer<T> dataInjector)
Group of agents.T - Agent TypeagentClass - Agent Class of agents to be created in this groupsize - Number of agents to create in this groupdataInjector - Function run when each agent is created which can be used to set
initialization values of agentGroup instancedefault <T extends Agent<S>> Group<T> loadGroup(java.lang.Class<T> clazz, Source source)
loadGroup(Class, Source, SerializableConsumer) without a data injector so
no initial function is run for agents<T extends Agent<S>> Group<T> loadGroup(java.lang.Class<T> agentClass, Source source, SerializableConsumer<T> dataInjector)
void setup()
Model getModel()
S getGlobals()
S. This object is created and added to system
with create(GlobalState, Model)) If no global state was added, GlobalState is returned.void registerMessageTypes(java.lang.Class<? extends Message>... types)
void registerLinkTypes(java.lang.Class<? extends Link>... types)
<T extends Agent<S>> AgentSelection<T> select(java.lang.Class<T> agentType)
AgentSelection which
allows further refinement of the selection through filters, and finally retrieving a result
through aggregation.T - Agent TypeagentType - Agent Class<T extends Agent<S>> AgentStatistics<T> stats(java.lang.Class<T> agentType)
AgentStatistics. AgentStatistics allows refinement of the agents selected, and the definition
of fields (or computed fields) for which statistics will be collected.T - Agent TypeagentType - Agent Classdefault LongAccumulator createLongAccumulator(java.lang.String name)
createLongAccumulator(String, String) using the name for reporting
purposes.default DoubleAccumulator createDoubleAccumulator(java.lang.String name)
createDoubleAccumulator(String, String) using the name for reporting
purposes.default LongAccumulator createLongAccumulator(java.lang.String name, java.lang.String displayName)
LongAccumulator.name - Name used to access this accumulatordisplayName - Name used for reporting the result of this accumulatorLongAccumulator instancedefault DoubleAccumulator createDoubleAccumulator(java.lang.String name, java.lang.String displayName)
DoubleAccumulator.name - Name used to access this accumulatordisplayName - Name used for reporting the result of this accumulatorLongAccumulator instanceLongAccumulator getLongAccumulator(java.lang.String name)
DoubleAccumulator getDoubleAccumulator(java.lang.String name)
java.util.Map<java.lang.String,DoubleAccumulator> getDoubleAccumulators()
java.util.Map<java.lang.String,LongAccumulator> getLongAccumulators()
void beginStep()
void done()
ModelContext getContext()
Configuration getConfig()
<T extends Agent<S>> long selectRandomAgent(java.lang.Class<T> agentType)
T - agentType -