-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
AgentSet.scala
39 lines (30 loc) · 1.15 KB
/
AgentSet.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo
package org.nlogo.api
/**
* Interface provides access to NetLogo agentsets. NetLogo agentsets may be composed of turtles,
* patches, or links (but an agentset may not contain a mix of different agent types.)
*
* In order to perform some functions on AgentSets you may need to cast to
* org.nlogo.agent.AgentSet.
*/
trait AgentSet {
/**
* Returns the name of the AgentSet, for all turtles, patches, or links returns its type,
* for breeds returns the breed name for all other sets returns an empty string
*/
def printName: String
/** Returns the number of agents in the set. */
def count: Int
/** Returns the type of agents in the AgentSet. */
def `type`: Class[_ <: Agent]
/** Returns the world object that this AgentSet is associated with. */
def world: World
/** Returns an iterable that cn be used to iterate through the agents in this set. */
def agents: java.lang.Iterable[Agent]
/**
* Reports true if this AgentSet and the given AgentSet have the exact same agents
*
* @param other the AgentSet to compare to
*/
def equalAgentSets(other: AgentSet): Boolean
}