public class Environment
extends java.lang.Object
Constructor and Description |
---|
Environment(int height,
int width,
int agentMaxSteps,
int queryMaxSteps,
float agentChance,
float eventChance,
float queryChance,
float nodeMaxDistance)
Construct and initialize the coordinate matrix with its limitations.
|
Modifier and Type | Method and Description |
---|---|
int |
eventHash(int timeStep,
Node node)
Creates hash-ID's for events.
|
float |
getAgentChance()
Gets the probability of an agent spawning.
|
int |
getAgentMaxSteps()
Gets how many steps an agent can take.
|
java.util.ArrayList<Node> |
getNeighbouringNodes(Node centerNode,
float maxDistance)
Retunrs a list of nodes surrounding a centerNode.
|
int |
getQueryMaxSteps()
Gets how many steps a query can take.
|
int |
getRunningSteps()
Returns how many steps the simulation as been running
|
void |
step()
Runs one timestep and increments steps with 1.
|
public Environment(int height, int width, int agentMaxSteps, int queryMaxSteps, float agentChance, float eventChance, float queryChance, float nodeMaxDistance)
height
- the vertical size of the matrixwidth
- the horizontal size of the matrixagentMaxSteps
- the limit of steps possible by the agentqueryMaxSteps
- the limit of steps possible by the queryagentChance
- the probability of an agent spawningeventChance
- the probability of an event spawningqueryChance
- the probability of a query spawningnodeMaxDistance
- the limit to the distance allowed between communicating nodespublic void step()
public int eventHash(int timeStep, Node node)
public float getAgentChance()
public int getAgentMaxSteps()
public int getQueryMaxSteps()
public int getRunningSteps()
public java.util.ArrayList<Node> getNeighbouringNodes(Node centerNode, float maxDistance)
centerNode
- node to be searched around.maxDistance
- max distance to be searched.