X hits on this document

62 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 views62
Page views62
Page last viewedMon Dec 05 19:26:28 UTC 2016
Pages30
Paragraphs495
Words6732

Comments