Package net.sf.tweety.agents
Class MultiAgentSystem<T extends Agent>
- java.lang.Object
- 
- net.sf.tweety.agents.MultiAgentSystem<T>
 
- 
- Type Parameters:
- T- the agent class.
 - All Implemented Interfaces:
- java.lang.Iterable<T>,- java.util.Collection<T>
 - Direct Known Subclasses:
- GroundedGameSystem,- LotteryGameSystem,- StructuredArgumentationSystem
 
 public class MultiAgentSystem<T extends Agent> extends java.lang.Object implements java.util.Collection<T>A multi-agent system is a collection of agents with some environment.- Author:
- Matthias Thimm
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intEXECUTE_TILL_TERMINATIONIndicates that the execution of this system's protocol should be repeated until it has terminated.
 - 
Constructor SummaryConstructors Constructor Description MultiAgentSystem(Environment environment)Creates a new empty multi-agent system with the given environment.MultiAgentSystem(Environment environment, java.util.Collection<? extends T> agents)Creates a new multi-agent system with the given collection of agents.
 - 
Method SummaryModifier and Type Method Description booleanadd(T e)booleanaddAll(java.util.Collection<? extends T> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object obj)voidexecute(AbstractProtocol protocol)Executes the given protocol till it terminates.booleanexecute(AbstractProtocol protocol, int numOfSteps)Executes the given protocol for the given number of steps.EnvironmentgetEnvironment()Returns the environment of this multi-agent system.inthashCode()booleanisEmpty()java.util.Iterator<T>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<S> S[]toArray(S[] a)- 
Methods inherited from class java.lang.ObjectgetClass, notify, notifyAll, toString, wait, wait, wait
 
- 
 
- 
- 
- 
Field Detail- 
EXECUTE_TILL_TERMINATIONpublic static final int EXECUTE_TILL_TERMINATION Indicates that the execution of this system's protocol should be repeated until it has terminated.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
MultiAgentSystempublic MultiAgentSystem(Environment environment) Creates a new empty multi-agent system with the given environment.- Parameters:
- environment- some environment.
 
 - 
MultiAgentSystempublic MultiAgentSystem(Environment environment, java.util.Collection<? extends T> agents) Creates a new multi-agent system with the given collection of agents.- Parameters:
- agents- a collection of agents.
- environment- some environment.
 
 
- 
 - 
Method Detail- 
getEnvironmentpublic Environment getEnvironment() Returns the environment of this multi-agent system.- Returns:
- the environment of this multi-agent system.
 
 - 
executepublic boolean execute(AbstractProtocol protocol, int numOfSteps) throws ProtocolTerminatedException, java.lang.IllegalArgumentException Executes the given protocol for the given number of steps. Set steps to Protocol.EXECUTE_TILL_TERMINATION to have the protocol executed till termination.- Parameters:
- protocol- a protocol.
- numOfSteps- the number of steps to be executed.
- Returns:
- "true" if the protocol has terminated after executing the given number of steps.
- Throws:
- ProtocolTerminatedException- if the protocol terminates before all steps could be executed.
- java.lang.IllegalArgumentException- if the given number of steps is zero or negative and not equal to Protocol.EXECUTE_TILL_TERMINATION.
 
 - 
executepublic void execute(AbstractProtocol protocol) throws ProtocolTerminatedException Executes the given protocol till it terminates.- Parameters:
- protocol- a protocol.
- Throws:
- ProtocolTerminatedException- if the protocol has already terminated.
 
 - 
addAllpublic boolean addAll(java.util.Collection<? extends T> c) 
 - 
containspublic boolean contains(java.lang.Object o) 
 - 
containsAllpublic boolean containsAll(java.util.Collection<?> c) 
 - 
isEmptypublic boolean isEmpty() 
 - 
iteratorpublic java.util.Iterator<T> iterator() 
 - 
removepublic boolean remove(java.lang.Object o) 
 - 
removeAllpublic boolean removeAll(java.util.Collection<?> c) 
 - 
retainAllpublic boolean retainAll(java.util.Collection<?> c) 
 - 
toArraypublic java.lang.Object[] toArray() 
 - 
toArraypublic <S> S[] toArray(S[] a) 
 - 
hashCodepublic int hashCode() 
 
- 
 
-