crowdmodel
Class Cluster

java.lang.Object
  extended by crowdmodel.CObject
      extended by crowdmodel.Cluster

public class Cluster
extends CObject

Cluster is a class that contains the functions to update the output measure: clusters A cluster is defined as a network structure that indicates a set of agents that either 1) perform the same behaviour 2) perform a specific behaviour 3) whatever way you would like to define a cluster.. For all connections counts that the agents are in each others physical vicinity (here range of sight). It is used as an output measure as this should represent observable group patterns that can also be compared in the real world. These clusters are represented as a graph (social network). Every time step the connections are created or updated between agents based on the current definition of a cluster. given the definition (1,2, ..) individuals are connected and can have a certain weight. This network is an unidirectional graph/network. We specify the connections in terms of: a) adding/removing edges given the current cluster definition, the clusters represent the current status b) updating the weights of the connections, given the definition weights are increased, which shows a development during time Note: I can also make this function independent from Repast by outputting in a file every time step still need to figure out what is the most convenient way to do so.

Author:
Nanda Wijermans

Field Summary
 double d_arousal1
           
 double d_arousal2
           
 double d_arousal3
           
 double d_behaviour1
           
 double d_behaviour2
           
 double d_behaviour3
           
 double d_ci1
           
 double d_ci2
           
 double d_ci3
           
(package private)  int d_cntEdges
           
(package private)  int d_crowdsize
           
 double d_danceAct1
           
 double d_danceAct2
           
 double d_danceAct3
           
 double d_danceExp1
           
 double d_danceExp2
           
 double d_danceExp3
           
 double d_danceUtil1
           
 double d_danceUtil2
           
 double d_danceUtil3
           
 double d_dancingLeaders1
           
 double d_dancingLeaders2
           
 double d_dancingLeaders3
           
(package private)  double[] d_distances
           
(package private)  CrowdAgent d_dummy1
           
(package private)  CrowdAgent d_dummy2
           
(package private)  CrowdAgent d_dummy3
           
(package private)  int d_exp_dens
           
(package private)  int d_exp_leadership
           
(package private)  int d_exp_safe
           
 double d_idDom1
           
 double d_idDom2
           
 double d_idDom3
           
 double d_leadercnt1
           
 double d_leadercnt2
           
 double d_leadercnt3
           
(package private)  double d_maxDensity
           
(package private)  double d_meanAgentDistance
           
(package private)  int d_n
           
(package private)  int d_numEdges
           
 double d_runAct1
           
 double d_runAct2
           
 double d_runAct3
           
 double d_runExp1
           
 double d_runExp2
           
 double d_runExp3
           
(package private)  int d_runlength
           
 double d_runningLeaders1
           
 double d_runningLeaders2
           
 double d_runningLeaders3
           
 double d_runUtil1
           
 double d_runUtil2
           
 double d_runUtil3
           
 double d_safeDom1
           
 double d_safeDom2
           
 double d_safeDom3
           
(package private)  java.lang.String d_safety_dist
           
(package private)  int d_seed
           
 double d_socDom1
           
 double d_socDom2
           
 double d_socDom3
           
 double d_subsDom1
           
 double d_subsDom2
           
 double d_subsDom3
           
(package private)  double d_sumDistances
           
(package private)  double d_varAgentDistance
           
 double d_walkAct1
           
 double d_walkAct2
           
 double d_walkAct3
           
 double d_walkExp1
           
 double d_walkExp2
           
 double d_walkExp3
           
 double d_walkingLeaders1
           
 double d_walkingLeaders2
           
 double d_walkingLeaders3
           
 double d_walkUtil1
           
 double d_walkUtil2
           
 double d_walkUtil3
           
 double d_x1
           
 double d_x2
           
 double d_x3
           
 double d_y1
           
 double d_y2
           
 double d_y3
           
 
Fields inherited from class crowdmodel.CObject
d_id, d_world_context
 
Constructor Summary
Cluster(int densityCondition, int safetyPrefCondition, int leadershipCondition)
          Constructor for cluster, initialises the vars
 
Method Summary
private  void calcDistanceIndicators()
          Sets the distance indicators for this time-step - Mean of the distances between agents : sum(distances) / n - Variance of the distances between agents : sum((distances - mean)^2) / (n-1)
 double getBehaviour1()
           
 double getBehaviour2()
           
 double getBehaviour3()
           
 double getCrowdSize()
           
 double getD_arousal1()
           
 double getD_arousal2()
           
 double getD_arousal3()
           
 double getD_ci1()
           
 double getD_ci2()
           
 double getD_ci3()
           
 double getD_dance1()
           
 double getD_dance2()
           
 double getD_dance3()
           
 double getD_danceExp1()
           
 double getD_danceExp2()
           
 double getD_danceExp3()
           
 double getD_danceUtil1()
           
 double getD_danceUtil2()
           
 double getD_danceUtil3()
           
 double getD_dancingLeaders1()
           
 double getD_dancingLeaders2()
           
 double getD_dancingLeaders3()
           
 CrowdAgent getD_dummy1()
           
 CrowdAgent getD_dummy2()
           
 CrowdAgent getD_dummy3()
           
 double getD_idDom1()
           
 double getD_idDom2()
           
 double getD_idDom3()
           
 double getD_leadercnt1()
           
 double getD_leadercnt2()
           
 double getD_leadercnt3()
           
 double getD_run1()
           
 double getD_run2()
           
 double getD_run3()
           
 double getD_runExp1()
           
 double getD_runExp2()
           
 double getD_runExp3()
           
 double getD_runningLeaders1()
           
 double getD_runningLeaders2()
           
 double getD_runningLeaders3()
           
 double getD_runUtil1()
           
 double getD_runUtil2()
           
 double getD_runUtil3()
           
 double getD_safeDom1()
           
 double getD_safeDom2()
           
 double getD_safeDom3()
           
 double getD_socDom1()
           
 double getD_socDom2()
           
 double getD_socDom3()
           
 double getD_subsDom1()
           
 double getD_subsDom2()
           
 double getD_subsDom3()
           
 double getD_walk1()
           
 double getD_walk2()
           
 double getD_walk3()
           
 double getD_walkExp1()
           
 double getD_walkExp2()
           
 double getD_walkExp3()
           
 double getD_walkingLeaders1()
           
 double getD_walkingLeaders2()
           
 double getD_walkingLeaders3()
           
 double getD_walkUtil1()
           
 double getD_walkUtil2()
           
 double getD_walkUtil3()
           
 double getD_x1()
           
 double getD_x2()
           
 double getD_x3()
           
 double getD_y1()
           
 double getD_y2()
           
 double getD_y3()
           
 int getDensityCondition()
          the experiment condition of the density 1 : low (1) 2 : medium (3) 3 : high (5.5)
 int getLeadershipCondition()
          the experiment condition of the leadership 0 : zero (0) leaders (0) 1 : low (25) leaders (1:28) 2 : medium (50) leaders (1:14) 3 : high (100) leaders (1:7)
 double getMeanAgentDistance()
          Returns the current sample mean
 double getRunLength()
           
 java.lang.String getSafetyDist()
           
 int getSafetyPrefCondition()
          the experiment condition of the safety preference 1 : low safety preference 2 : control condition, medium safety pref 3 : high safety preference
 double getSeed()
           
 int getSyncEdgeCnt()
           
 double getSynchronicity()
          Returns the number of edges that are present in the current time step.
 double getVarAgentDistance()
          Returns the current sample mean
 void resetCounters()
           
private  void resetNetwork()
          Removes all the existing connections (edges) in a given network.
 void setAgent4Tracking(CrowdAgent rndAgent1, CrowdAgent rndAgent2, CrowdAgent rndAgent3)
          Sets the agents that will be tracked during the current run of the simulation.
 int testSynchronicity()
          Returns the number of edges that are present in the current time step.
 void updateBClusters()
          Updates the connections between agents in terms of a social network structure (clusters).
 void updateBClustersWithoutNetwork()
          counts the synchronised behaviours without representing this in a network.
 void updateBSpecClusters(java.lang.String behaviour)
          Updates the connections between agents in terms of a social network structure (clusters).
 void updateBSpecEvolvedClusters(java.lang.String behaviour)
          Updates the connections between agents in terms of a social network structure (clusters).
 void updateClusters()
          Function that makes sure the network of clusters is updated.
 void updateClustersWithoutNetwork()
           
private  void updateDistance(CrowdAgent ca, CrowdAgent ca2)
          Updates the mean and variance of the measured distances between agents given a new distance of two agents.
private  void updateLifeHistory()
           
 void updateSameBehaviour(CrowdAgent ca, CrowdAgent ca2)
          Checks whether two agents show the same behaviour.
 void updateSameBehaviourCnt(CrowdAgent ca, CrowdAgent ca2)
          Checks whether two agents show the same behaviour.
 
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

d_crowdsize

int d_crowdsize

d_numEdges

int d_numEdges

d_cntEdges

int d_cntEdges

d_n

int d_n

d_sumDistances

double d_sumDistances

d_meanAgentDistance

double d_meanAgentDistance

d_varAgentDistance

double d_varAgentDistance

d_maxDensity

double d_maxDensity

d_distances

double[] d_distances

d_runlength

final int d_runlength

d_seed

final int d_seed

d_safety_dist

final java.lang.String d_safety_dist

d_exp_dens

final int d_exp_dens

d_exp_safe

final int d_exp_safe

d_exp_leadership

final int d_exp_leadership

d_dummy1

CrowdAgent d_dummy1

d_dummy2

CrowdAgent d_dummy2

d_dummy3

CrowdAgent d_dummy3

d_x1

public double d_x1

d_x2

public double d_x2

d_x3

public double d_x3

d_y1

public double d_y1

d_y2

public double d_y2

d_y3

public double d_y3

d_arousal1

public double d_arousal1

d_arousal2

public double d_arousal2

d_arousal3

public double d_arousal3

d_behaviour1

public double d_behaviour1

d_behaviour2

public double d_behaviour2

d_behaviour3

public double d_behaviour3

d_idDom1

public double d_idDom1

d_idDom2

public double d_idDom2

d_idDom3

public double d_idDom3

d_socDom1

public double d_socDom1

d_socDom2

public double d_socDom2

d_socDom3

public double d_socDom3

d_safeDom1

public double d_safeDom1

d_safeDom2

public double d_safeDom2

d_safeDom3

public double d_safeDom3

d_subsDom1

public double d_subsDom1

d_subsDom2

public double d_subsDom2

d_subsDom3

public double d_subsDom3

d_walkAct1

public double d_walkAct1

d_walkAct2

public double d_walkAct2

d_walkAct3

public double d_walkAct3

d_runAct1

public double d_runAct1

d_runAct2

public double d_runAct2

d_runAct3

public double d_runAct3

d_danceAct1

public double d_danceAct1

d_danceAct2

public double d_danceAct2

d_danceAct3

public double d_danceAct3

d_walkExp1

public double d_walkExp1

d_walkExp2

public double d_walkExp2

d_walkExp3

public double d_walkExp3

d_runExp1

public double d_runExp1

d_runExp2

public double d_runExp2

d_runExp3

public double d_runExp3

d_danceExp1

public double d_danceExp1

d_danceExp2

public double d_danceExp2

d_danceExp3

public double d_danceExp3

d_walkUtil1

public double d_walkUtil1

d_walkUtil2

public double d_walkUtil2

d_walkUtil3

public double d_walkUtil3

d_runUtil1

public double d_runUtil1

d_runUtil2

public double d_runUtil2

d_runUtil3

public double d_runUtil3

d_danceUtil1

public double d_danceUtil1

d_danceUtil2

public double d_danceUtil2

d_danceUtil3

public double d_danceUtil3

d_ci1

public double d_ci1

d_ci2

public double d_ci2

d_ci3

public double d_ci3

d_leadercnt1

public double d_leadercnt1

d_leadercnt2

public double d_leadercnt2

d_leadercnt3

public double d_leadercnt3

d_walkingLeaders1

public double d_walkingLeaders1

d_walkingLeaders2

public double d_walkingLeaders2

d_walkingLeaders3

public double d_walkingLeaders3

d_runningLeaders1

public double d_runningLeaders1

d_runningLeaders2

public double d_runningLeaders2

d_runningLeaders3

public double d_runningLeaders3

d_dancingLeaders1

public double d_dancingLeaders1

d_dancingLeaders2

public double d_dancingLeaders2

d_dancingLeaders3

public double d_dancingLeaders3
Constructor Detail

Cluster

public Cluster(int densityCondition,
               int safetyPrefCondition,
               int leadershipCondition)
Constructor for cluster, initialises the vars

Method Detail

setAgent4Tracking

public void setAgent4Tracking(CrowdAgent rndAgent1,
                              CrowdAgent rndAgent2,
                              CrowdAgent rndAgent3)
Sets the agents that will be tracked during the current run of the simulation. The individual state (internally) are recorded, which is to much to do that for all agents

Parameters:
rndAgent1 -
rndAgent2 -
rndAgent3 -

updateClusters

public void updateClusters()
Function that makes sure the network of clusters is updated. A cluster is the group measure, however the definition of the cluster can differ, this set here. Furthermore, here the update is assigned to the scheduler. The priority parameter makes sure this function is called last! (high number means high priority, and vise versa) As the agents need to be finished first.

Parameters:
crowdsize -

updateClustersWithoutNetwork

public void updateClustersWithoutNetwork()

resetCounters

public void resetCounters()

resetNetwork

private void resetNetwork()
Removes all the existing connections (edges) in a given network. Returns a network without connections (only nodes)

Parameters:
network -

updateBClustersWithoutNetwork

public void updateBClustersWithoutNetwork()
counts the synchronised behaviours without representing this in a network. Just for testing my MemoryOverloading as I suspect this is because of this network


updateBClusters

public void updateBClusters()
Updates the connections between agents in terms of a social network structure (clusters). This functions describes a type of social structure in which a cluster is defined as:
1) behaviour shown by the connected agents are the same
a) Where the structure represents the current state; meaning that presence of a connection is based on the current behaviour With the note that when agents move in a similar direction, we will perceive them as the same. However when not, they are not accounted for as similar or synchronised. We make use of the heading of the agents to indicate this.

Parameters:
agentContext -
behaviour -

updateSameBehaviour

public void updateSameBehaviour(CrowdAgent ca,
                                CrowdAgent ca2)
Checks whether two agents show the same behaviour. In case they are showing the same behaviour the counter is increased and a networkEdge is added between the two agents in the behaviourNetwork (social network structure)

Parameters:
ca -
ca2 -

updateSameBehaviourCnt

public void updateSameBehaviourCnt(CrowdAgent ca,
                                   CrowdAgent ca2)
Checks whether two agents show the same behaviour. In case they are showing the same behaviour the counter is increased (same as the updateSameBehaviour function without the network representation)

Parameters:
ca -
ca2 -

updateBSpecClusters

public void updateBSpecClusters(java.lang.String behaviour)
Updates the connections between agents in terms of a social network structure (clusters). This functions describes a type of social structure in which a cluster is defined as: 2) the behaviour they show is of a specific type a) Where the structure represents the current state; meaning that presence of a connection is based on the behaviour of the agents in the current time step

Parameters:
behaviour -

updateBSpecEvolvedClusters

public void updateBSpecEvolvedClusters(java.lang.String behaviour)
Updates the connections between agents in terms of a social network structure (clusters). This functions describes a type of social structure in which a cluster is defined as: 2) the behaviour they show is of a specific type b) Where the structure represents the evolved state; meaning that the presence and weight of a connection is the result of the past an now.

Parameters:
behaviour -

getSynchronicity

public double getSynchronicity()
Returns the number of edges that are present in the current time step. This indicates the synchronicity of the crowd. We developed a group measure clusters that indicates a cohesion or local synchronicity based on bilateral relations. In describing it as a group measure we aim to relate the group level (patterns) with the underlying processes.

Returns:
number of edges in the BehaviourNetwork

getSyncEdgeCnt

public int getSyncEdgeCnt()

testSynchronicity

public int testSynchronicity()
Returns the number of edges that are present in the current time step. This indicates the synchronicity of the crowd. We developed a group measure clusters that indicates a cohesion or local synchronicity based on bilateral relations. In describing it as a group measure we aim to relate the group level (patterns) with the underlying processes.

Returns:
number of edges in the BehaviourNetwork

updateDistance

private void updateDistance(CrowdAgent ca,
                            CrowdAgent ca2)
Updates the mean and variance of the measured distances between agents given a new distance of two agents.

Parameters:
ca -
ca2 -

calcDistanceIndicators

private void calcDistanceIndicators()
Sets the distance indicators for this time-step - Mean of the distances between agents : sum(distances) / n - Variance of the distances between agents : sum((distances - mean)^2) / (n-1)


updateLifeHistory

private void updateLifeHistory()

getD_x1

public double getD_x1()
Returns:
the d_x1

getD_x2

public double getD_x2()
Returns:
the d_x2

getD_x3

public double getD_x3()
Returns:
the d_x3

getD_y1

public double getD_y1()
Returns:
the d_y1

getD_y2

public double getD_y2()
Returns:
the d_y2

getD_walkingLeaders1

public double getD_walkingLeaders1()
Returns:
the d_walkingLeaders1

getD_walkingLeaders2

public double getD_walkingLeaders2()
Returns:
the d_walkingLeaders2

getD_walkingLeaders3

public double getD_walkingLeaders3()
Returns:
the d_walkingLeaders3

getD_runningLeaders1

public double getD_runningLeaders1()
Returns:
the d_runningLeaders1

getD_runningLeaders2

public double getD_runningLeaders2()
Returns:
the d_runningLeaders2

getD_runningLeaders3

public double getD_runningLeaders3()
Returns:
the d_runningLeaders3

getD_dancingLeaders1

public double getD_dancingLeaders1()
Returns:
the d_dancingLeaders1

getD_dancingLeaders2

public double getD_dancingLeaders2()
Returns:
the d_dancingLeaders2

getD_dancingLeaders3

public double getD_dancingLeaders3()
Returns:
the d_dancingLeaders3

getD_y3

public double getD_y3()
Returns:
the d_y3

getMeanAgentDistance

public double getMeanAgentDistance()
Returns the current sample mean

Returns:

getVarAgentDistance

public double getVarAgentDistance()
Returns the current sample mean

Returns:

getRunLength

public double getRunLength()
Returns:
run length

getCrowdSize

public double getCrowdSize()
Returns:
crowd size of this run

getSeed

public double getSeed()
Returns:
seed of this run

getSafetyDist

public java.lang.String getSafetyDist()
Returns:
distribution for the safety preference setting in this run

getDensityCondition

public int getDensityCondition()
the experiment condition of the density 1 : low (1) 2 : medium (3) 3 : high (5.5)

Returns:
the experiment condition of the density

getSafetyPrefCondition

public int getSafetyPrefCondition()
the experiment condition of the safety preference 1 : low safety preference 2 : control condition, medium safety pref 3 : high safety preference

Returns:
the experiment condition of the safety preference

getLeadershipCondition

public int getLeadershipCondition()
the experiment condition of the leadership 0 : zero (0) leaders (0) 1 : low (25) leaders (1:28) 2 : medium (50) leaders (1:14) 3 : high (100) leaders (1:7)

Returns:
the experiment condition of the leadership setting

getD_dummy1

public CrowdAgent getD_dummy1()
Returns:
the d_dummy1

getD_dummy2

public CrowdAgent getD_dummy2()
Returns:
the d_dummy2

getD_dummy3

public CrowdAgent getD_dummy3()
Returns:
the d_dummy3

getD_arousal1

public double getD_arousal1()
Returns:
the d_arousal1

getD_arousal2

public double getD_arousal2()
Returns:
the d_arousal2

getD_arousal3

public double getD_arousal3()
Returns:
the d_arousal3

getD_idDom1

public double getD_idDom1()
Returns:
the d_idDom1

getD_idDom2

public double getD_idDom2()
Returns:
the d_idDom2

getD_idDom3

public double getD_idDom3()
Returns:
the d_idDom3

getD_socDom1

public double getD_socDom1()
Returns:
the d_socDom1

getD_socDom2

public double getD_socDom2()
Returns:
the d_socDom2

getD_socDom3

public double getD_socDom3()
Returns:
the d_socDom3

getD_safeDom1

public double getD_safeDom1()
Returns:
the d_safeDom1

getD_safeDom2

public double getD_safeDom2()
Returns:
the d_safeDom2

getD_safeDom3

public double getD_safeDom3()
Returns:
the d_safeDom3

getD_subsDom1

public double getD_subsDom1()
Returns:
the d_subsDom1

getD_subsDom2

public double getD_subsDom2()
Returns:
the d_subsDom2

getD_subsDom3

public double getD_subsDom3()
Returns:
the d_subsDom3

getD_walk1

public double getD_walk1()
Returns:
the d_walk1

getD_walk2

public double getD_walk2()
Returns:
the d_walk2

getD_walk3

public double getD_walk3()
Returns:
the d_walk3

getD_run1

public double getD_run1()
Returns:
the d_run1

getD_run2

public double getD_run2()
Returns:
the d_run2

getD_run3

public double getD_run3()
Returns:
the d_run3

getD_dance1

public double getD_dance1()
Returns:
the d_dance1

getD_dance2

public double getD_dance2()
Returns:
the d_dance2

getD_dance3

public double getD_dance3()
Returns:
the d_dance3

getD_ci1

public double getD_ci1()
Returns:
the d_ci1

getD_ci2

public double getD_ci2()
Returns:
the d_ci2

getD_ci3

public double getD_ci3()
Returns:
the d_ci3

getBehaviour1

public double getBehaviour1()

getBehaviour2

public double getBehaviour2()

getBehaviour3

public double getBehaviour3()

getD_leadercnt1

public double getD_leadercnt1()
Returns:
the d_leadercnt1

getD_leadercnt2

public double getD_leadercnt2()
Returns:
the d_leadercnt2

getD_leadercnt3

public double getD_leadercnt3()
Returns:
the d_leadercnt3

getD_walkExp1

public double getD_walkExp1()
Returns:
the d_walkExp1

getD_walkExp2

public double getD_walkExp2()
Returns:
the d_walkExp2

getD_walkExp3

public double getD_walkExp3()
Returns:
the d_walkExp3

getD_walkUtil1

public double getD_walkUtil1()
Returns:
the d_walkUtil1

getD_walkUtil2

public double getD_walkUtil2()
Returns:
the d_walkUtil2

getD_walkUtil3

public double getD_walkUtil3()
Returns:
the d_walkUtil3

getD_runExp1

public double getD_runExp1()
Returns:
the d_runExp1

getD_runExp2

public double getD_runExp2()
Returns:
the d_runExp2

getD_runExp3

public double getD_runExp3()
Returns:
the d_runExp3

getD_danceExp1

public double getD_danceExp1()
Returns:
the d_danceExp1

getD_danceExp2

public double getD_danceExp2()
Returns:
the d_danceExp2

getD_danceExp3

public double getD_danceExp3()
Returns:
the d_danceExp3

getD_runUtil1

public double getD_runUtil1()
Returns:
the d_runUtil1

getD_runUtil2

public double getD_runUtil2()
Returns:
the d_runUtil2

getD_runUtil3

public double getD_runUtil3()
Returns:
the d_runUtil3

getD_danceUtil1

public double getD_danceUtil1()
Returns:
the d_danceUtil1

getD_danceUtil2

public double getD_danceUtil2()
Returns:
the d_danceUtil2

getD_danceUtil3

public double getD_danceUtil3()
Returns:
the d_danceUtil3