X hits on this document

78 views

0 shares

0 downloads

0 comments

13 / 30

) public void move() {

// Note the simulation time. def time = GetTickCountInTimeUnits()

// Use the Repast Simphony Groovy math tools. use (MathOperations.mathCategories()) {

// space and network finding ContinuousSpace space = (ContinuousSpace)FindProjection("Boids/Space") Network family = (Network)FindProjection("Boids/Family")

Network friends Context context // temp counter def counter = 1 def tempXYAngle def tempXZAngle def tempSpeed =

= (Network)FindProjection("Boids/Friends") = FindContext("Boids") defintion

= xyAngle = xzAngle speed

// Make a decision. for (friend in (new repast.simphony.query.AndQuery(new repast.simphony.query.space.continuous.ContinuousWithin(space, this, 20), new repast.simphony.query.NotQuery(context, new repast.simphony.query.space.graph.NetworkSuccessor(friends, this))).query())) {

// New Friend CreateEdge("Boids/Friends", this, friend, 1.0)

}

// Make a decision. for (friend in (new repast.simphony.query.AndQuery(new repast.simphony.query.NotQuery(context, new repast.simphony.query.space.continuous.ContinuousWithin(space, this, 40)), new repast.simphony.query.space.graph.NetworkSuccessor(friends, this)).query())) {

// remove friend RemoveEdge("Boids/Friends", this, friend)

}

// Make a decision. for (influence in (new repast.simphony.query.OrQuery(new repast.simphony.query.space.graph.NetPathWithin(family,this, 2), new repast.simphony.query.space.graph.NetPathWithin(friends, this, 3)).query())) {

// This is a task. counter = counter + 1 tempXYAngle = tempXYAngle + influence.xyAngle tempXZAngle = tempXZAngle + influence.xzAngle

Document info
Document views78
Page views78
Page last viewedSat Dec 10 13:31:59 UTC 2016
Pages30
Paragraphs495
Words6732

Comments