X hits on this document

84 views

0 shares

0 downloads

0 comments

14 / 30

tempSpeed = tempSpeed + influence.speed

}

// This is a task. tempXYAngle = tempXYAngle / counter tempXZAngle = tempXZAngle / counter setSpeed min (max(tempSpeed / counter + RandomDraw(-0.5, 0.5), 2), 2) space.moveByDisplacement(this, speed * tempXYAngle, speed * tempXYAngle, speed * tempXZAngle)

// Exit this scope. return

}

// End the method. return

}

/** *

  • *

    This method provides a human-readable name for the agent.

  • *

    @method toString

* */ @ProbeID() public String toString()

{

// Define the return

value variable.

def returnValue

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

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

// Set the default agent identifier. returnValue = this.agentID

}

// Return the results. return returnValue

}

}

Figure 5: Boids agent source code (in Groovy)

-

Document info
Document views84
Page views84
Page last viewedTue Jan 17 21:31:34 UTC 2017
Pages30
Paragraphs495
Words6732

Comments