public class TournamentManager
extends java.lang.Thread
SessionManager
are instantiated. It uses the
configuration object which is created by the user interface and extracts
individual session from configuration object which it wil pass on to the
session manager.
Agents in a tournament must be of class NegotiationParty
.
Constructor and Description |
---|
TournamentManager(MultilateralTournamentConfiguration config)
Initializes a new instance of the
TournamentManager class. |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(MultipartyNegotiationEventListener listener)
listener support
|
protected java.lang.Object |
clone() |
MultilateralProtocol |
getProtocol()
Create a new instance of the Protocol object from a
MultiPartyProtocolRepItem |
void |
removeEventListener(MultipartyNegotiationEventListener listener) |
void |
run()
Runnable implementation for thread
|
java.lang.Exception |
runSingleSession(java.util.List<NegotiationPartyInternal> parties,
ExecutorWithTimeout executor)
Run a single session for the given parties (protocol and session are also
used, but extracted from the tournament manager's configuration
|
void |
runTournament()
Run the complete tournament the number of times provided by the
configuration file
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public TournamentManager(MultilateralTournamentConfiguration config)
TournamentManager
class. The tournament
manager uses the provided configuration to find which sessions to run and
how many collections of these sessions (tournaments) to run.config
- The configuration to use for this Tournamentpublic void addEventListener(MultipartyNegotiationEventListener listener)
public void removeEventListener(MultipartyNegotiationEventListener listener)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void runTournament() throws java.lang.Exception
java.lang.Exception
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Thread
java.lang.CloneNotSupportedException
public java.lang.Exception runSingleSession(java.util.List<NegotiationPartyInternal> parties, ExecutorWithTimeout executor)
parties
- the parties to run the tournament forjava.lang.Exception
- if some of the required data could not be extractedpublic MultilateralProtocol getProtocol() throws InstantiateException
MultiPartyProtocolRepItem
protocolRepItem
- Item to create Protocol out ofInstantiateException
- if failure occurs while constructing the rep item.