X hits on this document

69 views

0 shares

0 downloads

0 comments

12 / 30

  • *

    This is the family finding behavior.

    • *

      @method findFamily

* */ @ScheduledMethod( start = 0d, priority = -1.7976931348623157E308d,

shuffle = true ) public void findFamily()

{

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

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

// Find the 3D space Context context = FindContext("Boids")

ContinuousSpace space = context.getProjection("Space") setXyAngle RandomDraw(0

(ContinuousSpace)

, 2 * Math.PI)

setXzAngle RandomDraw(0, 2 * Math.PI) setSpeed RandomDraw(-2, 2)

// Make a decision. for (neighbor in (new repast.simphony.query.space.continuous.ContinuousWithin(space, this, 25).query())) {

// Link to neighbors CreateEdge("Boids/Family", this, neighbor, 1.0) CreateEdge("Boids/Friends", this, neighbor, 1.0)

}

// Exit this scope. return

}

// End the method. return

}

/** *

  • *

    Move Behavior

    • *

      @method move

* */ @ScheduledMethod( start = 1d, interval = 1d, shuffle = true

Document info
Document views69
Page views69
Page last viewedWed Dec 07 23:13:01 UTC 2016
Pages30
Paragraphs495
Words6732

Comments