public class Configuration extends java.lang.Object implements GuiConfiguration, MultilateralTournamentConfiguration
MultilateralUI
user
interface. This class is also readable by the TournamentManager
to
start a new tournament.Constructor and Description |
---|
Configuration()
Initializes a new instance of the configuration class.
|
Configuration(Configuration config)
Initializes a new instance of the configuration class by using existing config.
|
Modifier and Type | Method and Description |
---|---|
static Protocol |
createFrom(MultiPartyProtocolRepItem protocolRepItem)
Create a new instance of the Protocol object from a
MultiPartyProtocolRepItem |
static NegotiationParty |
createFrom(PartyRepItem partyRepItem,
Domain domain)
Creates a new Party from repository items
|
static NegotiationParty |
createFrom(PartyRepItem partyRepItem,
ProfileRepItem profileRepItem)
Creates a new Party from repository items
|
static UtilitySpace |
createFrom(ProfileRepItem item)
Create a new UtilitySpace from a ProfileRepItem.
|
java.util.HashMap<DeadlineType,java.lang.Object> |
getDeadlines()
Gets the deadline map
|
int |
getMediatorIndex()
Gets the mediator index in the agent list
|
PartyRepItem |
getMediatorItem()
Gets the mediator
|
ProfileRepItem |
getMediatorProfile()
Gets the mediator profile
|
int |
getNumAgentsPerSession()
Gets the number of agents per session
|
int |
getNumSessions()
Gets the number of negotiation sessions to run
|
int |
getNumTournaments()
Gets the number of negotiation sessions to run
|
TournamentGenerator |
getPartiesGenerator()
Get the list of participating
NegotiationParty objects from this configuration |
java.util.List<PartyRepItem> |
getPartyItems()
Gets the list of party repository items.
|
java.util.List<ProfileRepItem> |
getPartyProfileItems()
Gets the list of profiles used by the parties
|
Protocol |
getProtocol()
Get the
Protocol object from this configuration |
MultiPartyProtocolRepItem |
getProtocolItem()
Gets the protocol to run
|
boolean |
getRepetitionAllowed()
Gets whether repetition is allowed when generating combinations of agents.
|
Session |
getSession()
Get the
Session object from this configuration |
java.lang.String |
getTournamentType()
Get the type of tournament
|
void |
setDeadlines(java.util.HashMap<DeadlineType,java.lang.Object> deadlines)
Sets the deadline map
|
void |
setMediatorIndex(int index)
Sets the mediator index in the agent list
|
void |
setMediatorItem(PartyRepItem mediatorItem)
Sets the mediator item
|
void |
setMediatorProfile(ProfileRepItem mediatorProfile)
Sets the mediator profile
|
void |
setNumAgentsPerSession(int numAgents)
Sets the number of agents per session
|
void |
setNumSessions(int numSessions)
Sets the number of negotiation sessions.
|
void |
setPartyItems(java.util.List<PartyRepItem> agents)
Sets the list of chosen parties
|
void |
setPartyProfileItems(java.util.List<ProfileRepItem> partyProfileItems)
Sets the list of profiles used by the parties
|
void |
setProtocolItem(MultiPartyProtocolRepItem protocolItem)
Sets the protocol to run.
|
void |
setRepetitionAllowed(boolean repetitionAllowed)
Sets whether repetition is allowed for generating sessions for the current agent
|
void |
setTournamentType(java.lang.String type)
Set the type of tournament
|
public Configuration()
public Configuration(Configuration config)
config
- the configuration to make a copy ofpublic static NegotiationParty createFrom(PartyRepItem partyRepItem, ProfileRepItem profileRepItem) throws java.lang.Exception
partyRepItem
- Party Repository item to createFrom party fromprofileRepItem
- Profile Repository item to createFrom party fromjava.lang.NoSuchMethodException
- If requested Party does not have a constructor accepting only preference profilesjava.lang.ClassNotFoundException
- If requested Party class can not be found.java.lang.Exception
- If Repository.copyFrom(negotiator.repository.Repository)
throws an exception.public static NegotiationParty createFrom(PartyRepItem partyRepItem, Domain domain) throws java.lang.Exception
partyRepItem
- Party Repository item to createFrom party fromdomain
- Profile Repository item to createFrom party fromjava.lang.NoSuchMethodException
- If requested Party does not have a constructor accepting only preference profilesjava.lang.ClassNotFoundException
- If requested Party class can not be found.java.lang.Exception
- If Repository.copyFrom(negotiator.repository.Repository)
throws an exception.public static Protocol createFrom(MultiPartyProtocolRepItem protocolRepItem) throws java.lang.Exception
MultiPartyProtocolRepItem
protocolRepItem
- Item to create Protocol out ofjava.lang.Exception
- If Repository.copyFrom(negotiator.repository.Repository)
throws an exception.public static UtilitySpace createFrom(ProfileRepItem item) throws java.lang.Exception
ProfileRepItem.getDomain()
returns new instead of an actual domain, this method also returns null.item
- the item to create a UtilitySpace out of.java.lang.Exception
- If Repository.copyFrom(negotiator.repository.Repository)
throws an exception.public int getMediatorIndex()
getMediatorIndex
in interface GuiConfiguration
public void setMediatorIndex(int index)
setMediatorIndex
in interface GuiConfiguration
index
- the index to usepublic java.util.HashMap<DeadlineType,java.lang.Object> getDeadlines()
getDeadlines
in interface GuiConfiguration
public void setDeadlines(java.util.HashMap<DeadlineType,java.lang.Object> deadlines)
setDeadlines
in interface GuiConfiguration
deadlines
- a map of deadline keys and their valuespublic java.util.List<PartyRepItem> getPartyItems()
getPartyItems
in interface GuiConfiguration
public void setPartyItems(java.util.List<PartyRepItem> agents)
setPartyItems
in interface GuiConfiguration
agents
- the list of all chosen partiespublic PartyRepItem getMediatorItem()
getMediatorItem
in interface GuiConfiguration
public void setMediatorItem(PartyRepItem mediatorItem)
setMediatorItem
in interface GuiConfiguration
mediatorItem
- the mediatorpublic int getNumSessions()
getNumSessions
in interface GuiConfiguration
public void setNumSessions(int numSessions)
setNumSessions
in interface GuiConfiguration
numSessions
- the number of sessionspublic int getNumTournaments()
getNumTournaments
in interface MultilateralTournamentConfiguration
public java.lang.String getTournamentType()
getTournamentType
in interface GuiConfiguration
public void setTournamentType(java.lang.String type)
setTournamentType
in interface GuiConfiguration
type
- the type of tournamentpublic MultiPartyProtocolRepItem getProtocolItem()
getProtocolItem
in interface GuiConfiguration
public void setProtocolItem(MultiPartyProtocolRepItem protocolItem)
setProtocolItem
in interface GuiConfiguration
protocolItem
- the protocol to runpublic java.util.List<ProfileRepItem> getPartyProfileItems()
getPartyProfileItems
in interface GuiConfiguration
public void setPartyProfileItems(java.util.List<ProfileRepItem> partyProfileItems)
setPartyProfileItems
in interface GuiConfiguration
partyProfileItems
- list of profiles used by the partiespublic int getNumAgentsPerSession()
getNumAgentsPerSession
in interface GuiConfiguration
public void setNumAgentsPerSession(int numAgents)
setNumAgentsPerSession
in interface GuiConfiguration
numAgents
- number of agentspublic boolean getRepetitionAllowed()
getRepetitionAllowed
in interface GuiConfiguration
public void setRepetitionAllowed(boolean repetitionAllowed)
setRepetitionAllowed
in interface GuiConfiguration
repetitionAllowed
- true if repetition is allowedpublic Session getSession()
Session
object from this configurationgetSession
in interface MultilateralTournamentConfiguration
public Protocol getProtocol() throws java.lang.Exception
Protocol
object from this configurationgetProtocol
in interface MultilateralTournamentConfiguration
java.lang.NoSuchMethodException
- If requested Party does not have a constructor accepting only preference profilesjava.lang.ClassNotFoundException
- If requested Party class can not be found.java.lang.Exception
- If Repository.copyFrom(negotiator.repository.Repository)
throws an exception.public TournamentGenerator getPartiesGenerator() throws java.lang.Exception
NegotiationParty
objects from this configurationgetPartiesGenerator
in interface MultilateralTournamentConfiguration
java.lang.NoSuchMethodException
- If requested Party does not have a constructor accepting only preference profilesjava.lang.ClassNotFoundException
- If requested Party class can not be found.java.lang.Exception
- If Repository.copyFrom(negotiator.repository.Repository)
throws an exception.public ProfileRepItem getMediatorProfile()
GuiConfiguration
getMediatorProfile
in interface GuiConfiguration
public void setMediatorProfile(ProfileRepItem mediatorProfile)
GuiConfiguration
setMediatorProfile
in interface GuiConfiguration
mediatorProfile
- the mediator's profile rep item or null if not existing