public class SessionManager
extends java.lang.Object
implements java.lang.Runnable
SessionManager
is responsible for enforcing the
MultilateralProtocol
during the Session
. This is the entry
point for the negotiation algorithm. The protocol and session parameters are
passed on from the GUI.Modifier and Type | Field and Description |
---|---|
static int |
MAX_UTIL_HISTORY |
Constructor and Description |
---|
SessionManager(java.util.List<NegotiationPartyInternal> parties,
MultilateralProtocol protocol,
Session session,
ExecutorWithTimeout exec)
Initializes a new instance of the
SessionManager object. |
Modifier and Type | Method and Description |
---|---|
void |
addLoggingListener(MultipartyNegotiationEventListener eventListener)
Adds a listener to the logging events.
|
java.util.List<java.util.List<java.lang.Double[]>> |
getAgentUtils()
Get the history of the utilities for all agents so far.
|
double[][] |
getAgreementUtilities()
Returns round number and utility value of agreement if any.
|
void |
run()
Run and wait for completion.
|
void |
runAndWait()
Runs the negotiation session and wait for it to complete.
|
public static final int MAX_UTIL_HISTORY
public SessionManager(java.util.List<NegotiationPartyInternal> parties, MultilateralProtocol protocol, Session session, ExecutorWithTimeout exec)
SessionManager
object. After
initialization this SessionManager
can be run()
.parties
- The parties to use in this session (including agents and
optionally mediators)protocol
- The protocol to use for this session.session
- A session object containing preset information (can also be a
new instance)public void run()
RuntimeException
.run
in interface java.lang.Runnable
public void runAndWait() throws InvalidActionError, java.lang.InterruptedException, java.util.concurrent.ExecutionException, NegotiationPartyTimeoutException
InvalidActionError
java.lang.InterruptedException
java.util.concurrent.ExecutionException
NegotiationPartyTimeoutException
public void addLoggingListener(MultipartyNegotiationEventListener eventListener)
eventListener
- The instance listening to logging eventspublic java.util.List<java.util.List<java.lang.Double[]>> getAgentUtils()
public double[][] getAgreementUtilities()