public class Global
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
AAMAS_2014_EXPERIMENTS
Temporary flag for use in AAMAS 2014 experiments
|
static java.lang.String |
AGENT_REPOSITORY
Path to agent repository
|
static java.lang.String |
DOMAIN_REPOSITORY
Path to domain repository
|
static java.lang.String |
logPrefix |
static java.lang.String |
logPreset |
static java.lang.String |
PROTOCOL_REPOSITORY
Path to protocol repository
|
static java.lang.String |
SIMULATOR_REPOSITORY
Path to simulator repository
|
Constructor and Description |
---|
Global() |
Modifier and Type | Method and Description |
---|---|
static MultiPartyProtocol |
createMultiPartyProtocolInstance(MultiPartyProtocolRepItem protRepItem,
java.util.ArrayList<PartyRepItem> partyRepItems,
java.util.ArrayList<AgentID> partyIDList,
java.util.ArrayList<ProfileRepItem> profileRepItems,
java.util.ArrayList<java.util.HashMap<AgentParameterVariable,AgentParamValue>> partyParams,
DeadlineType deadlineType,
int totalRoundOrTime) |
static Protocol |
createProtocolInstance(ProtocolRepItem protRepItem,
AgentRepItem[] agentRepItems,
ProfileRepItem[] profileRepItems,
java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams) |
static Protocol |
createProtocolInstance(ProtocolRepItem protRepItem,
AgentRepItem[] agentRepItems,
ProfileRepItem[] profileRepItems,
java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams,
java.lang.ClassLoader classLoader) |
static java.lang.String |
getAgentDescription(Agent agent)
Gives a useful agent name.
|
static java.lang.String |
getBinaryRoot() |
static java.lang.String |
getCurrentTime() |
static java.lang.String |
getDistributedOutcomesFileName() |
static java.lang.String |
getExtensiveOutcomesFileName() |
static java.lang.String |
getFileNameWithoutExtension(java.lang.String fileName) |
static java.lang.String |
getLocalDirName() |
static java.lang.String |
getOQMOutcomesFileName() |
static java.lang.String |
getOutcomesFileName() |
static java.lang.Class<Protocol> |
getProtocolClass(ProtocolRepItem protRepItem) |
static java.lang.Class<Protocol> |
getProtocolClass(ProtocolRepItem protRepItem,
java.lang.ClassLoader loader) |
static java.lang.String |
getTournamentOutcomeFileName() |
static boolean |
isJar() |
static Agent |
loadAgent(java.lang.String path)
Load an agent using the given classname/filename.
|
static Agent |
loadAgent(java.lang.String agentClassName,
java.lang.String variables)
load agent and then set the parameters.
|
static java.lang.Object |
loadClassFromFile(java.io.File file)
Load a file as a class.
|
static java.lang.Object |
loadObject(java.lang.String path)
Load an object from a given path.
|
static Party |
loadParty(java.lang.String partyClassName) |
static void |
showLoadError(java.io.File fc,
java.lang.Throwable e)
Show a dialog to the user, explaining the exception that was raised while
loading file fc.
|
public static final java.lang.String DOMAIN_REPOSITORY
public static final java.lang.String AGENT_REPOSITORY
public static final java.lang.String PROTOCOL_REPOSITORY
public static final java.lang.String SIMULATOR_REPOSITORY
public static java.lang.String logPrefix
public static java.lang.String logPreset
public static final boolean AAMAS_2014_EXPERIMENTS
public static java.lang.String getCurrentTime()
public static java.lang.String getLocalDirName()
public static java.lang.String getFileNameWithoutExtension(java.lang.String fileName)
public static java.lang.Class<Protocol> getProtocolClass(ProtocolRepItem protRepItem) throws java.lang.Exception
java.lang.Exception
public static java.lang.Class<Protocol> getProtocolClass(ProtocolRepItem protRepItem, java.lang.ClassLoader loader) throws java.lang.Exception
java.lang.Exception
public static Protocol createProtocolInstance(ProtocolRepItem protRepItem, AgentRepItem[] agentRepItems, ProfileRepItem[] profileRepItems, java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams) throws java.lang.Exception
java.lang.Exception
public static Protocol createProtocolInstance(ProtocolRepItem protRepItem, AgentRepItem[] agentRepItems, ProfileRepItem[] profileRepItems, java.util.HashMap<AgentParameterVariable,AgentParamValue>[] agentParams, java.lang.ClassLoader classLoader) throws java.lang.Exception
java.lang.Exception
public static MultiPartyProtocol createMultiPartyProtocolInstance(MultiPartyProtocolRepItem protRepItem, java.util.ArrayList<PartyRepItem> partyRepItems, java.util.ArrayList<AgentID> partyIDList, java.util.ArrayList<ProfileRepItem> profileRepItems, java.util.ArrayList<java.util.HashMap<AgentParameterVariable,AgentParamValue>> partyParams, DeadlineType deadlineType, int totalRoundOrTime) throws java.lang.Exception
java.lang.Exception
public static Party loadParty(java.lang.String partyClassName) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
public static java.lang.Object loadObject(java.lang.String path) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.net.MalformedURLException
we can't properly typecheck here. Generics fail as we have type erasure, and casting to the given type does NOTHING. So we leave this a general object and leave it to the caller to do the type checking.
path
- This can be either a class name or filename.java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.net.MalformedURLException
public static java.lang.Object loadClassFromFile(java.io.File file) throws java.net.MalformedURLException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
file
- the object to be loaded. Filename should end with ".class".java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.net.MalformedURLException
public static Agent loadAgent(java.lang.String path) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.net.MalformedURLException, java.lang.ClassCastException, java.lang.IllegalArgumentException
Agent.parseStrategyParameters(String)
classname
- This can be either a class name or filename.variables
- the variables to pass to the agent.java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalArgumentException
java.lang.ClassCastException
java.net.MalformedURLException
public static Agent loadAgent(java.lang.String agentClassName, java.lang.String variables) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.net.MalformedURLException, java.lang.ClassCastException, java.lang.IllegalArgumentException
loadAgent(String)
agentClassName
- variables
- java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.net.MalformedURLException
java.lang.ClassCastException
java.lang.IllegalArgumentException
public static java.lang.String getAgentDescription(Agent agent)
public static void showLoadError(java.io.File fc, java.lang.Throwable e)
loadObject(String)
and associates. Also dumps a copy of the full
stacktrace to the console, to help us debugging #906fc
- file that was attempted to be loadede
- the exception that was raisedpublic static java.lang.String getOutcomesFileName()
public static java.lang.String getDistributedOutcomesFileName()
public static java.lang.String getTournamentOutcomeFileName()
public static java.lang.String getExtensiveOutcomesFileName()
public static java.lang.String getOQMOutcomesFileName()
public static java.lang.String getBinaryRoot()
public static boolean isJar()