public interface Manager
Interface for workplaces to interact with the global state of computation.
Modifier and Type | Method and Description |
---|---|
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Map<java.lang.Object,java.lang.Object>> |
getLocalStatistics()
Returns a read-only view of local statistics map of a current node.
|
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Set<java.lang.String>> |
getNeighboursOf(long workplaceId)
Returns a read-only view of global statistics map filtered only for neighbours of the given workplace.
|
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Map<java.lang.Object,java.lang.Object>> |
getNeighboursStatistics(long workplaceId)
Returns a read-only view of global statistics map filtered only for neighbours of the given workplace.
|
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Map<java.lang.Object,java.lang.Object>> |
getStatistics()
Returns a read-only view of global statistics map of all available nodes.
|
int |
getTotalWorkplacesCount()
Returns the number of all workplaces that participate in computations.
|
boolean |
isStopConditionReached() |
void |
migrate(Agent agent,
long sourceWorkplace,
long targetWorkplace)
Migrates an agent to a workplace with the given ID in neighbourhood.
|
void |
migrate(Agent agent,
long sourceWorkplace,
java.lang.String neighbourAnnotation)
Migrates an agent to a workplace with the given annotation in neighbourhood.
|
void |
migrateUnconditionally(Agent agent,
long sourceWorkplace,
long targetWorkplace)
Migrates an agent to a workplace with the given ID.
|
void |
postStatistics(long id,
io.vavr.collection.Map<java.lang.Object,java.lang.Object> statistics)
Posts provided statistics globally, mapping them to the workplace ID.
|
void postStatistics(long id, io.vavr.collection.Map<java.lang.Object,java.lang.Object> statistics)
Posts provided statistics globally, mapping them to the workplace ID.
id
- workplace idstatistics
- statistics as a mapint getTotalWorkplacesCount()
Returns the number of all workplaces that participate in computations.
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Map<java.lang.Object,java.lang.Object>> getLocalStatistics()
Returns a read-only view of local statistics map of a current node.
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Map<java.lang.Object,java.lang.Object>> getStatistics()
Returns a read-only view of global statistics map of all available nodes.
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Map<java.lang.Object,java.lang.Object>> getNeighboursStatistics(long workplaceId)
Returns a read-only view of global statistics map filtered only for neighbours of the given workplace.
io.vavr.collection.Map<java.lang.Long,io.vavr.collection.Set<java.lang.String>> getNeighboursOf(long workplaceId)
Returns a read-only view of global statistics map filtered only for neighbours of the given workplace.
void migrate(Agent agent, long sourceWorkplace, long targetWorkplace)
Migrates an agent to a workplace with the given ID in neighbourhood.
This method always use the current topology.
void migrate(Agent agent, long sourceWorkplace, java.lang.String neighbourAnnotation)
Migrates an agent to a workplace with the given annotation in neighbourhood.
This method always use the current topology.
void migrateUnconditionally(Agent agent, long sourceWorkplace, long targetWorkplace)
Migrates an agent to a workplace with the given ID.
This method makes it possible to bypass a current topology.
boolean isStopConditionReached()