crowdmodel.agents
Class LocomotionRule

java.lang.Object
  extended by crowdmodel.agents.MemoryElement
      extended by crowdmodel.agents.Rule
          extended by crowdmodel.agents.BehaviourRule
              extended by crowdmodel.agents.LocomotionRule
All Implemented Interfaces:
java.lang.Comparable

public class LocomotionRule
extends BehaviourRule

A LocomotionRule describes the movement of the object that is asking for it Types of locomotion are person: A) vertical/body position: (not included) standing/upright sitting/seated kneeling/knelt lying/prone other B)horizontal: walking running/jogging marching (not included) dancing vehicular motion (not included) other object: move/transpose/displace

Author:
Nanda Wijermans

Field Summary
 java.lang.String d_domGoal
           
private  repast.simphony.space.continuous.NdPoint d_hpos
           
 CrowdAgent d_nearest
           
 double dichtstebije
           
private  java.util.ArrayList<java.lang.String> objectLocomotionList
           
static java.lang.String[] objectLocomotions
           
private  java.util.ArrayList<java.lang.String> personLocomotionList
           
static java.lang.String[] personLocomotions
           
 
Fields inherited from class crowdmodel.agents.MemoryElement
d_activation, d_baseLevel, d_contextLevel, d_id, d_name, d_thisAgent, d_thisAgentFlag, d_thisMemory, d_thisMemoryFlag
 
Constructor Summary
LocomotionRule(java.lang.String name)
          Constructor creates a locomotion rule with a predefined set of locomotion options
 
Method Summary
 double checkSurrounding(double v)
          braitenberg style surrounding check
 void dance()
          Describes a behaviour on the spot: dancing At this point it only implies that an individual occupies a larger area in space
 void execute()
          Executes the current locomotionRule At this point this is done by relating the name of the this rule with the corresponding function (predefined locomotion) for execution But can be reconsidered in doing this differently as all functions are described in every instantiation LocomotionRule class, however only one is associated/used.
 double getDichtstebije()
           
 repast.simphony.space.continuous.NdPoint getHpos()
          Returns the position this agent is heading to when moving social
 CrowdAgent getNearestAgent()
           
 void move(double v)
          MoveBraitenBerg describes movement still very simple, however if the target position ahead isn't walkable, the free spots +/-45 degrees the agent will move to that spot TODO update this description
 void moveOriginalMess(double v)
          Describes the movement of an agent.
 void moveSimple(double v)
          MoveSimple describes movement in the most simple form.
 void moveTest()
           
 void nothing()
          Do nothing behaviour :)
 double randomHeading()
          Changes the current heading of the agent in a random direction The random number generator generates a uniform value between [0,1) Meaning that the change of getting a number between 0 and 1 is just as likely (never becomes 1) By multiplying with 360 degrees, the range is scaled to [0,360)
 void run()
          Describes a moving behaviour: running Given a heading (based on current dominant goal) the agent moves with a velocity of 1.5 simulation units/tick (0.6 m/s)
 void setGoalHeading(java.lang.String domGoal)
          Changes the heading of an agent based on the dominant goal This is a pre-movement part of an action.
 void setHpos(repast.simphony.space.continuous.NdPoint hpos)
          Sets the position where this againt is heading to when moving social
 double socialHeading()
          Function describes the heading change of an agent as the pre-movement part of moveSocial behaviour This involves moving towards others, driven by the need to fulfil the vicinity of others At this point social movement is headed to others however needs to be refined: - moving towards friends/group-members - moving towards a specific person(s)
 double socialHeadingSimple()
          Turn to the agent that is the closest to you.
 double subsHeading()
          Function describes the heading change of an agent as the pre-movement part of moveSubs behaviour This involves moving towards the toilet or bar, driven by the need for subsistence satisfaction This can be achieved by going to the toilet or go to the bar.
 void walk()
          Describes the execution of a walking behaviour Given a certain heading the agent is walking in that direction.
 
Methods inherited from class crowdmodel.agents.BehaviourRule
compareTo, updateActivation
 
Methods inherited from class crowdmodel.agents.MemoryElement
approxB, contextActivation, getActivation, getID, getLastPrimeTime, getName, prime, setThisAgent, setThisMemory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

objectLocomotions

public static final java.lang.String[] objectLocomotions

personLocomotions

public static final java.lang.String[] personLocomotions

d_domGoal

public java.lang.String d_domGoal

objectLocomotionList

private java.util.ArrayList<java.lang.String> objectLocomotionList

personLocomotionList

private java.util.ArrayList<java.lang.String> personLocomotionList

dichtstebije

public double dichtstebije

d_nearest

public CrowdAgent d_nearest

d_hpos

private repast.simphony.space.continuous.NdPoint d_hpos
Constructor Detail

LocomotionRule

LocomotionRule(java.lang.String name)
Constructor creates a locomotion rule with a predefined set of locomotion options

Parameters:
name -
Method Detail

execute

public void execute()
Executes the current locomotionRule At this point this is done by relating the name of the this rule with the corresponding function (predefined locomotion) for execution But can be reconsidered in doing this differently as all functions are described in every instantiation LocomotionRule class, however only one is associated/used.

Overrides:
execute in class Rule
Parameters:
domGoal -
heading -
pos -

nothing

public void nothing()
Do nothing behaviour :)


walk

public void walk()
Describes the execution of a walking behaviour Given a certain heading the agent is walking in that direction.


run

public void run()
Describes a moving behaviour: running Given a heading (based on current dominant goal) the agent moves with a velocity of 1.5 simulation units/tick (0.6 m/s)


dance

public void dance()
Describes a behaviour on the spot: dancing At this point it only implies that an individual occupies a larger area in space


setGoalHeading

public void setGoalHeading(java.lang.String domGoal)
Changes the heading of an agent based on the dominant goal This is a pre-movement part of an action. Dominant ID: head towards the stage Dominant Soc: head towards others driven by the need to belong to a group (social goal) that is fulfilled by being in the vicinity of others At this point social movement is headed to others (in general) however needs to be refined: - moving towards friends/group-members - moving towards a specific person(s) Dominant Safety: head to low density areas This involves moving away from high density areas, driven by the need to feel safe. (safety goal) that is fulfilled by non-crowded surroundings Implemented by walking in a arbitrary direction at this point TODO(needs refinement) Dominant Subsistence: head to toilet or bar driven by the need for energy (Energy goal) At this point movement toward the toilet or bar depends on which one is more close


socialHeading

public double socialHeading()
Function describes the heading change of an agent as the pre-movement part of moveSocial behaviour This involves moving towards others, driven by the need to fulfil the vicinity of others At this point social movement is headed to others however needs to be refined: - moving towards friends/group-members - moving towards a specific person(s)

Returns:
heading

socialHeadingSimple

public double socialHeadingSimple()
Turn to the agent that is the closest to you. Is not used now, is the simple, 1st version of socialHeading()

Returns:
heading

subsHeading

public double subsHeading()
Function describes the heading change of an agent as the pre-movement part of moveSubs behaviour This involves moving towards the toilet or bar, driven by the need for subsistence satisfaction This can be achieved by going to the toilet or go to the bar. Depending on which of them will bring satisfaction to the agent. In going to the bar or toilet, the agent has 3 points where it can Fulfil its needs. It selects the one that is most nearby, however when it is crowded the agent will move to the next one. returns the heading suitable leading to subsistence goal satisfaction


randomHeading

public double randomHeading()
Changes the current heading of the agent in a random direction The random number generator generates a uniform value between [0,1) Meaning that the change of getting a number between 0 and 1 is just as likely (never becomes 1) By multiplying with 360 degrees, the range is scaled to [0,360)


moveSimple

public void moveSimple(double v)
MoveSimple describes movement in the most simple form. Given a current heading and velocity the new target position is calculated. Given the walkability of that position the agent will move, otherwise it will stand still.

Parameters:
velocity -

move

public void move(double v)
MoveBraitenBerg describes movement still very simple, however if the target position ahead isn't walkable, the free spots +/-45 degrees the agent will move to that spot TODO update this description

Parameters:
velocity -

checkSurrounding

public double checkSurrounding(double v)
braitenberg style surrounding check


moveOriginalMess

public void moveOriginalMess(double v)
Describes the movement of an agent. Given a heading and a walking speed an approachable target location is found.


moveTest

public void moveTest()

getDichtstebije

public double getDichtstebije()
Returns:
the dichtstebije

getNearestAgent

public CrowdAgent getNearestAgent()
Returns:
the nearest agents

getHpos

public repast.simphony.space.continuous.NdPoint getHpos()
Returns the position this agent is heading to when moving social

Returns:

setHpos

public void setHpos(repast.simphony.space.continuous.NdPoint hpos)
Sets the position where this againt is heading to when moving social

Parameters:
hpos -