public class TournamentGenerator
extends java.lang.Object
Agents in a tournament must be of class NegotiationParty
.
Constructor and Description |
---|
TournamentGenerator(MultilateralTournamentConfiguration configuration,
TournamentIndicesGenerator indicesGenerator)
Creates a new instance of the
TournamentGenerator class. |
Modifier and Type | Method and Description |
---|---|
static MultilateralProtocol |
createFrom(MultiPartyProtocolRepItem protocolRepItem)
Create a new instance of the Protocol object from a
MultiPartyProtocolRepItem |
protected static UTILITYSPACETYPE |
extractUtilitySpaceType(ProfileRepItem profile) |
static java.util.List<java.lang.Integer> |
generateIntegerList(int upToExclusive)
Generates a list of integer values.
|
protected static NegotiationPartyInternal |
generateMediator(PartyRepItem mediatorRepItem,
ProfileRepItem alternativeProfileRepItem,
Session session)
Generates a mediator Party from the given information
|
static java.util.List<NegotiationPartyInternal> |
generateSessionParties(java.util.List<java.lang.Integer> partyIndices,
java.util.List<PartyRepItem> partyRepItems,
java.util.List<ProfileRepItem> profileRepItems,
java.util.List<AgentID> partyIds,
Session session)
Generate the list of parties in the given session
|
static java.util.List<NegotiationPartyInternal> |
generateSessionParties(java.util.List<PartyRepItem> partyRepItems,
java.util.List<ProfileRepItem> profileRepItems,
java.util.List<AgentID> partyIds,
Session session)
Generate the list of parties in the given session, including mediator(s)
|
boolean |
hasNext() |
java.util.List<NegotiationPartyInternal> |
next()
returns next list of negotiating parties for the next session.
|
int |
numSessionsPerTournament() |
public TournamentGenerator(MultilateralTournamentConfiguration configuration, TournamentIndicesGenerator indicesGenerator)
TournamentGenerator
class.configuration
- The configuration used for the tournamentsindicesGenerator
- The indices generator used to generate lists of partiespublic static MultilateralProtocol 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 java.util.List<NegotiationPartyInternal> generateSessionParties(java.util.List<PartyRepItem> partyRepItems, java.util.List<ProfileRepItem> profileRepItems, java.util.List<AgentID> partyIds, Session session) throws RepositoryException, NegotiatorException
partyRepItems
- The repository items for partiesprofileRepItems
- The ProfileRepItem
s, NOT including profiles for
mediators.session
- The session used fot this sessionpartyIds
- the ids to use for the profile items (so excluding mediators).
null will generate a default name for the party.NegotiatorException
- if agent can not be createdRepositoryException
- if repository describing agent can not be loadedpublic static java.util.List<NegotiationPartyInternal> generateSessionParties(java.util.List<java.lang.Integer> partyIndices, java.util.List<PartyRepItem> partyRepItems, java.util.List<ProfileRepItem> profileRepItems, java.util.List<AgentID> partyIds, Session session) throws RepositoryException, NegotiatorException
partyIndices
- The indices used for generating the sessionpartyRepItems
- The repository items for party, including the mediator(s).profileRepItems
- The repository items for profiles. One party will be created
for each item in the list. No mediator profiles should be
included. The mediator(s) will get the first profilepartyIds
- the preferred party IDs for each of the profileRepItems (so
excluding the mediators), in the correct order. If null,
default IDs are generated (recommended). If a list, the number
of elements in this list must match the size of list.
profileRepItems.session
- The session used for this sessionRepositoryException
- if repository describing agent can not be loadedNegotiatorException
- if agent can not be createdpublic static java.util.List<java.lang.Integer> generateIntegerList(int upToExclusive)
upToExclusive
- The number to generate the list fromprotected static NegotiationPartyInternal generateMediator(PartyRepItem mediatorRepItem, ProfileRepItem alternativeProfileRepItem, Session session) throws RepositoryException, NegotiatorException
mediatorRepItem
- The mediator repository item (must not be null).alternativeProfileRepItem
- If no profile item is given, this is used to get the domainsession
- The session used fot this sessionNegotiatorException
RepositoryException
protected static UTILITYSPACETYPE extractUtilitySpaceType(ProfileRepItem profile)
public java.util.List<NegotiationPartyInternal> next() throws RepositoryException, NegotiatorException
NegotiatorException
- if agent can not be createdRepositoryException
- if repository describing agent can not be loadedpublic boolean hasNext()
public int numSessionsPerTournament()