public class MultiAgentSystem<T extends Agent> extends Object implements Collection<T>
| Modifier and Type | Field and Description |
|---|---|
static int |
EXECUTE_TILL_TERMINATION
Indicates that the execution of this system's protocol should
be repeated until it has terminated.
|
| Constructor and Description |
|---|
MultiAgentSystem(Environment environment)
Creates a new empty multi-agent system with the given environment.
|
MultiAgentSystem(Environment environment,
Collection<? extends T> agents)
Creates a new multi-agent system with the given collection of agents.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj) |
void |
execute(AbstractProtocol protocol)
Executes the given protocol till it terminates.
|
boolean |
execute(AbstractProtocol protocol,
int numOfSteps)
Executes the given protocol for the given number of steps.
|
Environment |
getEnvironment()
Returns the environment of this multi-agent system.
|
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<S> S[] |
toArray(S[] a) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitparallelStream, removeIf, spliterator, streampublic static final int EXECUTE_TILL_TERMINATION
public MultiAgentSystem(Environment environment)
environment - some environment.public MultiAgentSystem(Environment environment, Collection<? extends T> agents)
agents - a collection of agents.environment - some environment.public Environment getEnvironment()
public boolean execute(AbstractProtocol protocol, int numOfSteps) throws ProtocolTerminatedException, IllegalArgumentException
protocol - a protocol.numOfSteps - the number of steps to be executed.ProtocolTerminatedException - if the protocol terminates before all
steps could be executed.IllegalArgumentException - if the given number of steps is zero or
negative and not equal to Protocol.EXECUTE_TILL_TERMINATION.public void execute(AbstractProtocol protocol) throws ProtocolTerminatedException
protocol - a protocol.ProtocolTerminatedException - if the protocol has already terminated.public boolean add(T e)
add in interface Collection<T extends Agent>public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T extends Agent>public void clear()
clear in interface Collection<T extends Agent>public boolean contains(Object o)
contains in interface Collection<T extends Agent>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T extends Agent>public boolean isEmpty()
isEmpty in interface Collection<T extends Agent>public boolean remove(Object o)
remove in interface Collection<T extends Agent>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T extends Agent>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T extends Agent>public int size()
size in interface Collection<T extends Agent>public Object[] toArray()
toArray in interface Collection<T extends Agent>public <S> S[] toArray(S[] a)
toArray in interface Collection<T extends Agent>public int hashCode()
Copyright © 2018. All rights reserved.