EdgeAgents

scalation.simulation.agent.EdgeAgents
trait EdgeAgents

The EdgeAgents trait keeps track of which agents are on a particular edge, e.g., Link, Transport. It also allows agents to be found based on their location on a edge.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Link
class Transport

Members list

Value members

Concrete methods

def add(agent: SimAgent): ArrayDeque[SimAgent]

Add the given agent to the end of list (e.g., start of a transport).

Add the given agent to the end of list (e.g., start of a transport).

Value parameters

agent

the agent being added to the end

Attributes

def indexAt(loc: Double): Int

Find the agent whose distance down the edge is at least loc.

Find the agent whose distance down the edge is at least loc.

Value parameters

loc

the location at which the agent is sought (closest larger)

Attributes

def indexOf(agent: SimAgent): Int

Find the given agent in the list and return its index position.

Find the given agent in the list and return its index position.

Value parameters

agent

the agent whose index is sought (< 0 => not found)

Attributes

def indexWhere(p: SimAgent => Boolean): Int

Find the first agent in the list that satifies the given predicate and return its index position (< 0 => not found).

Find the first agent in the list that satifies the given predicate and return its index position (< 0 => not found).

Value parameters

p

the predicate to be satified

Attributes

def insert(index: Int, agent: SimAgent): Unit

Insert the given agent at the specified index position.

Insert the given agent at the specified index position.

Value parameters

agent

the agent being added at the given position

Attributes

def insertAfter(agent: SimAgent, agent2: SimAgent): Unit

Insert the given agent after agent2 in the list.

Insert the given agent after agent2 in the list.

Value parameters

agent

the new agent being added after agent2

agent2

the existing agent to insert it after

Attributes

def remove(agent: SimAgent): SimAgent

Remove the given agent from the list.

Remove the given agent from the list.

Value parameters

agent

the agent being removed from the list

Attributes

Remove the first agent from the list.

Remove the first agent from the list.

Attributes