|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcrowdmodel.CObject
crowdmodel.agents.CrowdAgent
public class CrowdAgent
Base class for a crowd agent (individual) An agent in this simulation refers to an computational individual in a crowd. An agent consists out of physiological properties and a memory.
Field Summary | |
---|---|
private repast.simphony.context.Context<CrowdAgent> |
d_agent_context
|
private int |
d_agentID
|
private boolean |
d_cannotMove
|
int |
d_dance
|
double |
d_danceUtil
|
private double |
d_density
|
int |
d_densityCondition
|
double |
d_distNearestAgent
|
private boolean |
d_dummy
|
private int |
d_dummyColor
|
boolean |
d_groupA
|
private double |
d_heading
|
private double |
d_internalTime
|
private boolean |
d_leader
|
int |
d_leadershipCondition
|
private int |
d_leaderType
|
Memory |
d_memory
|
java.lang.String |
d_myBehaviour
|
private repast.simphony.space.continuous.NdPoint |
d_mypos
|
private java.util.Vector<CrowdAgent> |
d_nearbyAgents
|
CrowdAgent |
d_nearestAgent
|
private int |
d_numDancingLeaders
|
private int |
d_numOthers
|
private int |
d_numRunningLeaders
|
private int |
d_numVisibleLeaders
|
private int |
d_numVisibleOthers
|
private int |
d_numWalkingLeaders
|
private double |
d_occupation_diameter
|
Physiology |
d_physiology
|
private java.lang.String |
d_POI
|
private java.util.Vector<CrowdAgent> |
d_prevAgentsInSight
|
private double |
d_prevIdSatis
|
private java.util.Vector<CrowdAgent> |
d_prevNearbyAgents
|
private repast.simphony.space.continuous.NdPoint |
d_prevPos
|
private double |
d_prevSafeSatis
|
private double |
d_prevSocSatis
|
private double |
d_prevSubsSatis
|
int |
d_run
|
double |
d_runUtil
|
int |
d_safetyCondition
|
int |
d_sameAsLeader
|
private boolean |
d_satisfied
|
private double |
d_visibleArea
|
private java.util.Vector<CrowdAgent> |
d_visibleOthers
|
int |
d_walk
|
double |
d_walkUtil
|
repast.simphony.space.continuous.NdPoint |
heading2point
|
Fields inherited from class crowdmodel.CObject |
---|
d_id, d_world_context |
Constructor Summary | |
---|---|
CrowdAgent(int agentID,
repast.simphony.context.Context<CObject> worldContext,
repast.simphony.context.Context<CrowdAgent> agentContext)
This constructor creates and initialises an agent |
Method Summary | |
---|---|
double |
calcUtil(BehaviourRule b)
Calculates a value (utility value) to compare two behaviours with each other. |
void |
checkRange(Goal goal)
Function that checks and when necessary corrects the range of the satisfaction value of a goal to stay between [0,1] |
double |
clusterIndex()
Function indicates the relative crowdedness around an agent. |
BehaviourRule |
compare(BehaviourRule b)
Compares the current behaviour ready for execution with the next behaviour. |
void |
decreaseInternalTime(double val)
|
double |
getActivationBruleDance()
Returns the current activation of the memory element: dance (behaviour rule) |
double |
getActivationBruleRun()
Returns the current activation of the memory element: run (behaviour rule) |
double |
getActivationBruleWalk()
Returns the current activation of the memory element: walk (behaviour rule) |
int |
getAgentID()
Returns the ID of an agent |
double |
getAgentMove2x()
|
double |
getAgentMove2y()
|
java.lang.String |
getAgentPOI()
Returns the name of the point of interest an agent is heading towards?? |
double |
getArousalLevel()
|
double |
getBladderLevel()
|
boolean |
getCannotMove()
Returns whether an agent is inhibited in its current movement or not |
int |
getCntVisibleLeaders()
|
double |
getDanceExp()
|
double |
getDanceUtil()
|
double |
getDensity()
|
int |
getDensityCondition()
the experiment condition of the density 1 : low (1) 2 : medium (3) 3 : high (5.5) |
double |
getDistNearestAgent()
|
int |
getDomGoal()
Returns the dominant goal in a integer notation identity (0); social (1); safety (2); subsistence (3) |
java.lang.String |
getDomGoalString()
Returns the dominant goal |
java.lang.String |
getDomPhysio()
Returns the dominant influence given (subsistence-related) physiology |
int |
getDummyColor()
|
boolean |
getGroupMembership()
Function returns whether an agent is member of a group At this point specifically to belong to group (A) or not |
double |
getHeading()
Returns the heading of the current CrowdAgent |
double |
getIDdominance()
Returns the current goal dominance of the identity goal |
double |
getIDlevel()
Returns the current level of satisfaction of the identity goal |
int |
getIDNearestAgent()
|
double |
getIDpref()
Satisfaction preference of the Identity goal for this agent (heterogeneous & static attribute of the agent) |
void |
getInfo()
Retrieves the information from the external world based on the constraints upon perception. |
int |
getIsDancing()
|
int |
getIsRunning()
|
int |
getIsWalking()
|
boolean |
getLeadership()
Returns whether this agent is a leader or not note: this is a perception an agent of itself being a leader or not At this point in my simulation this also means that others view this agent as a leader, however this is setup as a perception of those others too. |
int |
getLeadershipCondition()
the experiment condition of the number of leaders 1 : zero leaders (0) 2 : low amount of leaders (25) 1:28 3 : medium amount of leaders (50) 1:14 4: high amount of leaders (100) 1:7 |
java.lang.String |
getLeadershipType()
Returns the type of leader an agent is. |
repast.simphony.space.continuous.NdPoint |
getMyPos()
|
double |
getMyPosx()
|
double |
getMyPosy()
|
java.util.Vector<CrowdAgent> |
getNearbyAgents()
|
CrowdAgent |
getNearestAgent()
|
int |
getNumDancingLeaders()
|
int |
getNumRunningLeaders()
|
int |
getNumVisibleOthers()
|
int |
getNumWalkingLeaders()
|
java.lang.String |
getObservableB()
Returns the behaviour of that this agent is currently showing. |
int |
getObservableBNum()
Returns the behaviour an individual is showing in a numerical value 1 = walk 2 = run 3 = dance 4 = inhibited no behaviour - system.out.errrrr! |
double |
getOccupationDiameter()
Returns the diameter of the area an individual occupies. |
double |
getPerceivedDensity()
Returns the local density perceived by this individual |
int |
getPerceivedOthers()
|
java.util.Vector |
getPrevAgentsInsight()
|
double |
getPrevIdSatis()
|
java.util.Vector |
getPrevNearbyAgents()
|
repast.simphony.space.continuous.NdPoint |
getPrevPos()
|
double |
getPrevSafeSatis()
|
double |
getPrevSocSatis()
|
double |
getPrevSubsSatis()
|
repast.simphony.space.continuous.NdPoint |
getRandomLocation()
|
double |
getRunExp()
|
double |
getRunUtil()
|
double |
getSafeDominance()
Returns the current goal dominance of the safety goal |
double |
getSafelevel()
Returns the current level of satisfaction of the safety goal |
double |
getSafepref()
Satisfaction preference of the Safety goal for this agent (heterogeneous & static attribute of the agent) |
int |
getSafetyCondition()
the experiment condition of the safety preference 1 : low safety preference 2 : control condition, medium safety pref 3 : high safety preference |
int |
getSameBasLeader()
|
boolean |
getSatisfied()
Returns the whether an agent is satisfied meaning whether all its goals are currently fullfilled or not |
double |
getSocDominance()
Returns the current goal dominance of the social goal |
double |
getSocialpref()
Satisfaction preference of the Social goal for this agent (heterogeneous & static attribute of the agent) |
double |
getSoclevel()
Returns the current level of satisfaction of the social goal |
double |
getStomachLevel()
|
double |
getSubsDominance()
Returns the current goal dominance of the subsistence goal |
double |
getSubslevel()
Returns the current level of satisfaction of the subsistence goal |
double |
getSubspref()
satisfaction preference of the Subsistence goal for this agent (heterogeneous & static attribute of the agent) |
int |
getSurroundedness()
returns the number of people surrounding this individual within 1 simulation unit (=0.4 meters) |
java.util.Vector<CrowdAgent> |
getVisibleOthers()
|
double |
getWalkExp()
|
double |
getWalkUtil()
|
boolean |
ingroup(CrowdAgent otherAgent)
Function that checks whether another agent is part of the same group as this agent. |
void |
init(int exp_dens,
int exp_safe,
int exp_leader)
Initialisation function of the agents |
void |
initPos(repast.simphony.space.graph.Network socNetwork)
Initially agents are placed randomly in the world. |
boolean |
isDummy()
|
boolean |
isLeader()
|
private void |
leaveQueue()
Makes sure agents don't stand on or in front of the bar or toilet after they are completely satisfied |
void |
ooBehave()
A behaviour is chosen and executed. |
void |
perceive()
In this model perception is 'hard-coded', this means that no intelligent algorithm is behind perception. |
void |
primeMemory()
When an agents observes the world around it, information enters the cognitive system that directly affect the agent in terms of activation or dominance. |
void |
resetCounters()
Resets the counters |
private void |
resetInternalTime()
Function that sets the internal time an agent has to select a behaviour This is based upon the arousal level of an individual. |
void |
setCannotMove(boolean b)
Indicates whether the agent in inhibited by it's physical surroundings in moving |
private void |
setDistNearestAgent(double dichtstebije)
|
void |
setHeading(double heading)
Sets the heading of the current CrowdAgent |
void |
setLeadership()
Sets an agent to be a leader |
void |
setLeadership(int leaderType)
Sets an agent to be a leader and the the type of influence the agent will steer to this can be: peaceful or warful/toward aggression mind that this is the perception of the agent itself as being a leader. |
void |
setMyLeaders(java.util.HashSet<CrowdAgent> leaders)
Sets the agent with the persons it perceives as a leader |
void |
setNearestAgent(CrowdAgent nearest)
|
void |
setObservableB(java.lang.String name)
Sets a variable with the explicit behaviour performed by this agent It checkes whether the behaviour that was intended to executed has really been executed, otherwise it says that is was obstructed while trying. |
void |
setOccupationDiameter(double d_occupation_diameter)
Sets the area an individual occupies. |
void |
setSatisfied(boolean bool)
Indicates whether an agent is satisfied. |
void |
setToDummy(int color)
Sets this agent to be a dummy. |
void |
updateFacts()
Facts are updated according to the current situation. |
void |
updateGoals()
The update of the goals describe the effect the current situation has (external and internal state/perception) has on the satisfaction of the goals an individual has. |
void |
updatePhysiology()
Describes the effect every time step upon physiology. |
void |
updateTestVars()
The step function defines what an agent does every simulation step/tick. |
Methods inherited from class crowdmodel.CObject |
---|
CObject, delete, getID, step |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int d_agentID
private final repast.simphony.context.Context<CrowdAgent> d_agent_context
public final Memory d_memory
public final Physiology d_physiology
private double d_internalTime
private final double d_visibleArea
private repast.simphony.space.continuous.NdPoint d_mypos
private double d_heading
private double d_occupation_diameter
private boolean d_leader
private int d_leaderType
public boolean d_groupA
private boolean d_cannotMove
private boolean d_satisfied
private int d_numVisibleOthers
private java.util.Vector<CrowdAgent> d_visibleOthers
private int d_numOthers
private java.util.Vector<CrowdAgent> d_nearbyAgents
private double d_density
private int d_numVisibleLeaders
private java.lang.String d_POI
public java.lang.String d_myBehaviour
public int d_walk
public int d_run
public int d_dance
public int d_sameAsLeader
public double d_walkUtil
public double d_runUtil
public double d_danceUtil
private boolean d_dummy
private int d_dummyColor
private double d_prevIdSatis
private double d_prevSocSatis
private double d_prevSafeSatis
private double d_prevSubsSatis
private repast.simphony.space.continuous.NdPoint d_prevPos
private java.util.Vector<CrowdAgent> d_prevNearbyAgents
private java.util.Vector<CrowdAgent> d_prevAgentsInSight
public double d_distNearestAgent
public CrowdAgent d_nearestAgent
public repast.simphony.space.continuous.NdPoint heading2point
public int d_densityCondition
public int d_safetyCondition
public int d_leadershipCondition
private int d_numWalkingLeaders
private int d_numRunningLeaders
private int d_numDancingLeaders
Constructor Detail |
---|
public CrowdAgent(int agentID, repast.simphony.context.Context<CObject> worldContext, repast.simphony.context.Context<CrowdAgent> agentContext)
Method Detail |
---|
public void init(int exp_dens, int exp_safe, int exp_leader)
public void initPos(repast.simphony.space.graph.Network socNetwork)
public void updateTestVars()
public void perceive()
public void ooBehave()
private void leaveQueue()
private void setDistNearestAgent(double dichtstebije)
public void setNearestAgent(CrowdAgent nearest)
public void resetCounters()
public void getInfo()
public void primeMemory()
public void updatePhysiology()
public void updateGoals()
public void checkRange(Goal goal)
goal
- public void updateFacts()
public BehaviourRule compare(BehaviourRule b)
b
-
public double calcUtil(BehaviourRule b)
b
-
public boolean ingroup(CrowdAgent otherAgent)
otherAgent
-
private void resetInternalTime()
public void decreaseInternalTime(double val)
public repast.simphony.space.continuous.NdPoint getRandomLocation()
public int getAgentID()
public java.lang.String getAgentPOI()
public void setHeading(double heading)
public double getHeading()
public int getDomGoal()
public java.lang.String getDomGoalString()
public double getIDdominance()
public int getNumWalkingLeaders()
public int getNumRunningLeaders()
public int getNumDancingLeaders()
public double getSocDominance()
public double getSafeDominance()
public double getSubsDominance()
public double getIDlevel()
public double getSoclevel()
public double getSafelevel()
public double getSubslevel()
public void setLeadership(int leaderType)
leaderType
- public void setLeadership()
public boolean getLeadership()
public java.lang.String getLeadershipType()
public boolean getGroupMembership()
public repast.simphony.space.continuous.NdPoint getMyPos()
public int getSurroundedness()
public int getPerceivedOthers()
public void setCannotMove(boolean b)
b
- public boolean getCannotMove()
public void setObservableB(java.lang.String name)
name
- public java.lang.String getObservableB()
public int getObservableBNum()
public double getActivationBruleWalk()
public double getActivationBruleRun()
public double getActivationBruleDance()
public double getOccupationDiameter()
public void setOccupationDiameter(double d_occupation_diameter)
d_occupation_diameter
- public void setSatisfied(boolean bool)
bool
- public boolean getSatisfied()
public java.lang.String getDomPhysio()
public double getPerceivedDensity()
public double getPrevIdSatis()
public double getPrevSocSatis()
public double getPrevSafeSatis()
public double getPrevSubsSatis()
public repast.simphony.space.continuous.NdPoint getPrevPos()
public java.util.Vector getPrevNearbyAgents()
public java.util.Vector getPrevAgentsInsight()
public double clusterIndex()
public double getArousalLevel()
public double getDensity()
public java.util.Vector<CrowdAgent> getNearbyAgents()
public double getDistNearestAgent()
public int getIDNearestAgent()
public CrowdAgent getNearestAgent()
public int getNumVisibleOthers()
public java.util.Vector<CrowdAgent> getVisibleOthers()
public double getIDpref()
public double getSocialpref()
public double getSafepref()
public double getSubspref()
public double getStomachLevel()
public double getBladderLevel()
public double getAgentMove2x()
public double getAgentMove2y()
public double getMyPosx()
public double getMyPosy()
public double getWalkExp()
public double getRunExp()
public double getDanceExp()
public int getDensityCondition()
public int getSafetyCondition()
public int getLeadershipCondition()
public void setToDummy(int color)
public boolean isDummy()
public int getDummyColor()
public boolean isLeader()
public void setMyLeaders(java.util.HashSet<CrowdAgent> leaders)
leaders
- public int getIsWalking()
public int getIsRunning()
public int getIsDancing()
public int getCntVisibleLeaders()
public int getSameBasLeader()
public double getDanceUtil()
public double getRunUtil()
public double getWalkUtil()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |