public class TournamentGenerator extends java.lang.Object implements java.lang.Iterable<java.util.List<NegotiationParty>>
Constructor and Description |
---|
TournamentGenerator(Configuration config,
TournamentIndicesGenerator<java.lang.Integer> indicesGenerator)
Creates a new instance of the
TournamentGenerator class. |
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,
UTILITYSPACETYPE type,
java.util.Map<DeadlineType,java.lang.Object> deadlines)
Creates a new Party from repository items
|
static NegotiationParty |
createFrom(PartyRepItem partyRepItem,
ProfileRepItem profileRepItem,
java.util.Map<DeadlineType,java.lang.Object> deadlines)
Creates a new Party from repository items
|
static UtilitySpace |
createFrom(ProfileRepItem item)
Create a new UtilitySpace from a ProfileRepItem.
|
protected static UTILITYSPACETYPE |
extractUtilitySpaceType(ProfileRepItem profile) |
static java.util.List<java.lang.Integer> |
generateIntegerList(int upToExclusive)
Generates a list of integer values.
|
protected static NegotiationParty |
generateMediator(PartyRepItem mediatorRepItem,
ProfileRepItem mediatorProfileRepItem,
ProfileRepItem alternativeProfileRepItem,
java.util.Map<DeadlineType,java.lang.Object> deadlines)
Generates a mediator Party from the given information
|
static java.util.List<NegotiationParty> |
generateSessionParties(java.util.List<java.lang.Integer> partyIndices,
java.util.List<PartyRepItem> partyRepItems,
java.util.List<ProfileRepItem> profileRepItems,
java.util.List<AgentID> partyIds,
int mediatorIndex,
PartyRepItem mediatorRepItem,
ProfileRepItem mediatorProfileRepItem,
java.util.Map<DeadlineType,java.lang.Object> deadlines)
Generate the list of parties in the given session
|
static java.util.List<NegotiationParty> |
generateSessionParties(java.util.List<PartyRepItem> partyRepItems,
java.util.List<ProfileRepItem> profileRepItems,
java.util.List<AgentID> partyIds,
int mediatorIndex,
PartyRepItem mediatorRepItem,
ProfileRepItem mediatorProfileRepItem,
java.util.Map<DeadlineType,java.lang.Object> deadlines)
Generate the list of parties in the given session
|
java.util.Iterator<java.util.List<NegotiationParty>> |
iterator()
Returns an iterator over a set of elements of type T.
|
public TournamentGenerator(Configuration config, TournamentIndicesGenerator<java.lang.Integer> indicesGenerator)
TournamentGenerator
class.config
- The configuration used for the tournamentsindicesGenerator
- The indices generator used to generate lists of partiespublic static NegotiationParty createFrom(PartyRepItem partyRepItem, ProfileRepItem profileRepItem, java.util.Map<DeadlineType,java.lang.Object> deadlines) 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 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 static NegotiationParty createFrom(PartyRepItem partyRepItem, Domain domain, UTILITYSPACETYPE type, java.util.Map<DeadlineType,java.lang.Object> deadlines) 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 java.util.List<NegotiationParty> generateSessionParties(java.util.List<PartyRepItem> partyRepItems, java.util.List<ProfileRepItem> profileRepItems, java.util.List<AgentID> partyIds, int mediatorIndex, PartyRepItem mediatorRepItem, ProfileRepItem mediatorProfileRepItem, java.util.Map<DeadlineType,java.lang.Object> deadlines)
partyRepItems
- The repository items for partiesprofileRepItems
- The repository items for profilesmediatorIndex
- The index of the mediator in the returned list (usually this is 0)mediatorRepItem
- The mediator repository item (or null)mediatorProfileRepItem
- The mediator repository profile (or null)deadlines
- The deadlines used fot this sessionpublic static java.util.List<NegotiationParty> generateSessionParties(java.util.List<java.lang.Integer> partyIndices, java.util.List<PartyRepItem> partyRepItems, java.util.List<ProfileRepItem> profileRepItems, java.util.List<AgentID> partyIds, int mediatorIndex, PartyRepItem mediatorRepItem, ProfileRepItem mediatorProfileRepItem, java.util.Map<DeadlineType,java.lang.Object> deadlines)
partyIndices
- The indices used for generating the sessionpartyRepItems
- The repository items for partiesprofileRepItems
- The repository items for profilesmediatorIndex
- The index of the mediator in the returned list (usually this is 0)mediatorRepItem
- The mediator repository item (or null)mediatorProfileRepItem
- The mediator repository profile (or null)deadlines
- The deadlines used fot this sessionpublic static java.util.List<java.lang.Integer> generateIntegerList(int upToExclusive)
upToExclusive
- The number to generate the list fromprotected static NegotiationParty generateMediator(PartyRepItem mediatorRepItem, ProfileRepItem mediatorProfileRepItem, ProfileRepItem alternativeProfileRepItem, java.util.Map<DeadlineType,java.lang.Object> deadlines)
mediatorRepItem
- The mediator repository itemmediatorProfileRepItem
- The mediator repository profile (or null)alternativeProfileRepItem
- If no profile item is given, this is used to get the domaindeadlines
- The deadlines used fot this sessionprotected static UTILITYSPACETYPE extractUtilitySpaceType(ProfileRepItem profile)
public java.util.Iterator<java.util.List<NegotiationParty>> iterator()
iterator
in interface java.lang.Iterable<java.util.List<NegotiationParty>>