|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
A convenience class to create agents. More...

Public Member Functions | |
| AgentFactory (Document problemDesc, Document agentDesc) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, String outputFilePath) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, long timeout) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, String outputFilePath, long timeout) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, Collection<? extends StatsReporter > solGatherers) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, String outputFilePath, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean statsToController) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean statsToController) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean useTCP, boolean statsToController) | |
| Constructor. | |
| AgentFactory (Document problemDesc, Document agentDesc, String outputFilePath, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean useTCP, boolean statsToController) | |
| Constructor. | |
| AgentFactory (ProblemInterface< V, U > problem, Document agentDesc, Collection<? extends StatsReporter > solGatherers, Long timeout) | |
| Constructor. | |
| AgentFactory (ProblemInterface< V, U > problem, Document agentDesc, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean useTCP) | |
| Constructor. | |
| AgentFactory (ProblemInterface< V, U > problem, Document agentDesc, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean useTCP, boolean statsToController) | |
| Constructor. | |
| AgentFactory (ProblemInterface< V, U > problem, Document agentDesc, String outputFilePath, Collection<? extends StatsReporter > solGatherers, Long timeout, boolean useTCP, boolean statsToController) | |
| Constructor. | |
| void | restart (ProblemInterface< V, U > problem) |
| Restarts the algorithm on a new problem. | |
| void | end () |
| Kills all agents and threads. | |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| Does nothing. | |
| long | getNcccs () |
| long | getTime () |
| int | getNbrMsgs () |
| long | getTotalMsgSize () |
| long | getOverallMaxMsgSize () |
| TreeMap< MessageType, Integer > | getMsgNbrs () |
| TreeMap< Object, Integer > | getMsgNbrsSentPerAgent () |
| TreeMap< Object, Integer > | getMsgNbrsReceivedPerAgent () |
| TreeMap< MessageType, Long > | getMsgSizes () |
| TreeMap< Object, Long > | getMsgSizesSentPerAgent () |
| TreeMap< Object, Long > | getMsgSizesReceivedPerAgent () |
| TreeMap< MessageType, Long > | getMaxMsgSizes () |
| boolean | timedOut () |
| boolean | outOfMemory () |
| Map< String, V > | getCurrentSolution () |
| Method used to obtain the final solution in the case of a time out or an OutOfMemory exceptions. | |
| Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T > | |
| default void | notifyIn (Message msg, Object toAgent) |
| Notifies the listener of an incoming message. | |
Static Public Member Functions | |
| static< V extends Addable< V > U extends Addable< U > AgentInterface< V > | createAgent (QueueOutputPipeInterface toDaemonPipe, QueueOutputPipeInterface toControllerPipe, ProblemInterface< V, U > probDesc, Document agentDesc, int port) |
| static< V extends Addable< V > U extends Addable< U > AgentInterface< V > | createAgent (QueueOutputPipeInterface toDaemonPipe, QueueOutputPipeInterface toControllerPipe, ProblemInterface< V, U > probDesc, Document agentDesc, boolean statsToController, int port) |
| static< V extends Addable< V > U extends Addable< U > AgentInterface< V > | createAgent (QueueOutputPipeInterface controllerPipe, ProblemInterface< V, U > probDesc, Document agentDesc, CentralMailer mailman) |
| static void | main (String[] args) |
| Runs the input algorithm on the input problem. | |
| static void | printMsgStats (Map< MessageType, Integer > msgNbrs, Map< Object, Integer > msgNbrsSentPerAgent, Map< Object, Integer > msgNbrsReceivedPerAgent, Map< MessageType, Long > msgSizes, Map< Object, Long > msgSizesSentPerAgent, Map< Object, Long > msgSizesReceivedPerAgent, Map< MessageType, Long > maxMsgSizes) |
| Prints the message statistics. | |
Static Public Attributes | |
| static long | DEFAULT_TIMEOUT = 600000 |
| The default timeout in milliseconds. | |
Protected Member Functions | |
| AgentFactory () | |
| Empty constructor. | |
Static Package Functions | |
| [static initializer] | |
Private Member Functions | |
| void | init (Collection<? extends StatsReporter > solGatherers, Long timeout, boolean statsToController) |
| Convenience method called by constructors to reuse code. | |
| ProblemInterface | parseProblem (Document problemDesc) throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException |
| Parses the given problem. | |
| void | waitForEnd () |
| Waits for the algorithm to terminate. | |
| void | writeSol () |
| Writes the reported solution to the output file. | |
Static Private Member Functions | |
| static boolean | assertWarning () |
Prints a warning a returns true. | |
| static< V extends Addable< V > U extends Addable< U > AgentInterface< V > | instantiateAgent (ProblemInterface< V, U > probDesc, Document agentDesc, CentralMailer mailman) throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException |
Private Attributes | |
| Queue | queue |
| The queue used to listen to the agents. | |
| int | nbrAgents |
| Total number of agents. | |
| Map< String, AgentInterface< V > > | agents |
| All agents, indexed by their IDs. | |
| Map< String, ProblemInterface< V, U > > | subProbs |
| Each agent's subproblem. | |
| int | nbrAgentsFinished |
| Number of agents finished. | |
| Object | nbrAgentsFinished_lock = new Object () |
| Used to synchronize access to nbrAgentsFinished. | |
| boolean | done = false |
| Whether the agents have finished. | |
| Map< Object, QueueOutputPipeInterface > | pipes = new HashMap<Object, QueueOutputPipeInterface> () |
| For each agent, its input pipe. | |
| QueueIOPipe | pipe |
| The central listener's own pipe. | |
| int | nbrMsgsReceived = 0 |
| Used to track the number of various types of messages received from the agents. | |
| final boolean | measureMsgs |
| Whether to measure the number of messages and the total amount of information sent. | |
| TreeMap< MessageType, Integer > | msgNbrs = new TreeMap<MessageType, Integer> () |
| For each message type, the number of messages sent of that type. | |
| TreeMap< Object, Integer > | msgNbrsSentPerAgent = new TreeMap<Object, Integer> () |
| For each agent, the number of messages sent by that agent. | |
| TreeMap< Object, Integer > | msgNbrsReceivedPerAgent = new TreeMap<Object, Integer> () |
| For each agent, the number of messages received by that agent. | |
| TreeMap< MessageType, Long > | msgSizes = new TreeMap<MessageType, Long> () |
| For each message type, the total amount of information sent in messages of that type, in bytes. | |
| TreeMap< Object, Long > | msgSizesSentPerAgent = new TreeMap<Object, Long> () |
| For each agent, the total amount of information sent by that agent, in bytes. | |
| TreeMap< Object, Long > | msgSizesReceivedPerAgent = new TreeMap<Object, Long> () |
| For each agent, the total amount of information received by that agent, in bytes. | |
| TreeMap< MessageType, Long > | maxMsgSizes = new TreeMap<MessageType, Long> () |
| For each message type, the size (in bytes) of the largest message. | |
| boolean | statsToController |
| If true, stats should be sent to the controller; else, to the daemon. | |
| long | startTime |
| The start time of the algorithm, in milliseconds. | |
| boolean | silent = false |
| Whether information should be printed out. | |
| long | finalTime = -1 |
| The timestamp (in nanoseconds) of the AGENT_FINISHED message with the highest time stamp. | |
| long | finalNCCCcount = -1 |
| The nccc stamp of the AGENT_FINISHED message with the highest nccc stamp. | |
| long | timeout = DEFAULT_TIMEOUT |
| The timeout in milliseconds. | |
| boolean | timedOut = false |
true when the agent factory timed out before all the agents finished | |
| final boolean | measureTime |
Whether we should measure simulated time (true) or wall clock time (false). | |
| Document | agentDesc |
| The agent configuration. | |
| ProblemInterface< V, U > | problem |
| The problem. | |
| CentralMailer | mailman |
| The CentralMailer. | |
| final boolean | useTCP |
| Whether to use TCP pipes or shared memory pipes. | |
| boolean | outOfMemory |
true when algorithm ran out of memory | |
| final String | outputFilePath |
| The path to the output file. | |
| SolutionCollector< V, U > | solCollector |
| The solution collector. | |
Static Private Attributes | |
| static int | port = 5000 |
| The TCP port used for the first agent, which gets incremented for each subsequent agent. | |
A convenience class to create agents.
| <V> | the type used for variable values |
| <U> | the type used for utility values |
|
protected |
Empty constructor.
Referenced by [static initializer](), AgentFactory(), init(), main(), and restart().
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
References agentDesc.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| String | outputFilePath ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| outputFilePath | the path to the output file |
References agentDesc, and outputFilePath.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| long | timeout ) |
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| String | outputFilePath, | ||
| long | timeout ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| outputFilePath | the path to the output file |
| timeout | the timeout in milliseconds |
References agentDesc, outputFilePath, and timeout.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| Collection<? extends StatsReporter > | solGatherers ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
References agentDesc.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| String | outputFilePath, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | statsToController ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| outputFilePath | the path to the output file |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, outputFilePath, statsToController, and timeout.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | statsToController ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, statsToController, and timeout.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | useTCP, | ||
| boolean | statsToController ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| useTCP | Whether to use TCP pipes or shared memory pipes |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, statsToController, timeout, and useTCP.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | Document | problemDesc, |
| Document | agentDesc, | ||
| String | outputFilePath, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | useTCP, | ||
| boolean | statsToController ) |
Constructor.
| problemDesc | the problem description |
| agentDesc | the agent description |
| outputFilePath | the path to the output file |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| useTCP | Whether to use TCP pipes or shared memory pipes |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, AgentFactory(), measureMsgs, measureTime, outputFilePath, parseProblem(), problem, statsToController, timeout, and useTCP.

| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | ProblemInterface< V, U > | problem, |
| Document | agentDesc, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout ) |
Constructor.
| problem | the problem |
| agentDesc | the agent description |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | ProblemInterface< V, U > | problem, |
| Document | agentDesc, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | useTCP ) |
Constructor.
| problem | the problem |
| agentDesc | the agent description |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| useTCP | Whether to use TCP pipes or shared memory pipes |
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | ProblemInterface< V, U > | problem, |
| Document | agentDesc, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | useTCP, | ||
| boolean | statsToController ) |
Constructor.
| problem | the problem |
| agentDesc | the agent description |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| useTCP | Whether to use TCP pipes or shared memory pipes |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, problem, statsToController, timeout, and useTCP.
| frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.AgentFactory | ( | ProblemInterface< V, U > | problem, |
| Document | agentDesc, | ||
| String | outputFilePath, | ||
| Collection<? extends StatsReporter > | solGatherers, | ||
| Long | timeout, | ||
| boolean | useTCP, | ||
| boolean | statsToController ) |
Constructor.
| problem | the problem |
| agentDesc | the agent description |
| outputFilePath | the path to the output file |
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| useTCP | Whether to use TCP pipes or shared memory pipes |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, init(), measureMsgs, measureTime, outputFilePath, problem, statsToController, timeout, and useTCP.

|
staticpackage |
|
staticprivate |
|
static |
References agentDesc, instantiateAgent(), mailman, and frodo2.algorithms.AgentInterface< V extends Addable< V > >.setup().

|
static |
References agentDesc, instantiateAgent(), port, frodo2.algorithms.AgentInterface< V extends Addable< V > >.setup(), and statsToController.

|
static |
References agentDesc, createAgent(), and port.
Referenced by createAgent(), frodo2.algorithms.adopt.test.ADOPTagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.asodpop.tests.ASODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryAgentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.duct.tests.DUCTagentTest.testRandom(), frodo2.algorithms.localSearch.dsa.tests.DSAagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.localSearch.mgm.tests.MGMagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.odpop.tests.ODPOPagentTest< V extends Addable< V >, U extends Addable< U > >.testRandom(), frodo2.algorithms.odpop.tests.ODPOPagentTestBinaryDomains< V extends Addable< V >, U extends Addable< U > >.testRandom(), and frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.testRandom().

| void frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.end | ( | ) |
Kills all agents and threads.
References agents, mailman, and queue.
Referenced by frodo2.algorithms.dpop.count.SolutionCounter< V extends Addable< V >, U extends Addable< U > >.count(), and frodo2.gui.SimpleGUI.solveProblem().
| Map< String, V > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getCurrentSolution | ( | ) |
Method used to obtain the final solution in the case of a time out or an OutOfMemory exceptions.
References agents.
| TreeMap< MessageType, Long > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMaxMsgSizes | ( | ) |
| TreeMap< MessageType, Integer > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgNbrs | ( | ) |
| TreeMap< Object, Integer > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgNbrsReceivedPerAgent | ( | ) |
References msgNbrsReceivedPerAgent.
| TreeMap< Object, Integer > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgNbrsSentPerAgent | ( | ) |
References msgNbrsSentPerAgent.
| TreeMap< MessageType, Long > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgSizes | ( | ) |
| TreeMap< Object, Long > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgSizesReceivedPerAgent | ( | ) |
References msgSizesReceivedPerAgent.
| TreeMap< Object, Long > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgSizesSentPerAgent | ( | ) |
References msgSizesSentPerAgent.
| Collection< MessageType > frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_CONNECTED, frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.algorithms.AgentInterface< V extends Addable< V > >.ComStatsMessage.COM_STATS_MSG_TYPE, frodo2.communication.mailer.CentralMailer.ERROR_MSG, frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_ADDRESS_REQUEST, frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_REPORTING, and frodo2.communication.mailer.CentralMailer.OutOfMemMsg.
| int frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getNbrMsgs | ( | ) |
| long frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getNcccs | ( | ) |
| long frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getOverallMaxMsgSize | ( | ) |
| long frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getTime | ( | ) |
References finalTime.
| long frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.getTotalMsgSize | ( | ) |
|
private |
Convenience method called by constructors to reuse code.
| solGatherers | listeners that will be notified of the statistics sent by the agents (if not null, behaves silently) |
| timeout | the timeout, in milliseconds. If null, uses the default timeout. |
| statsToController | if true, stats should be sent to the controller; else, to the daemon |
References agentDesc, AgentFactory(), agents, frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.algorithms.StatsReporter.getStatsFromQueue(), init(), mailman, nbrAgents, pipe, port, problem, queue, silent, statsToController, subProbs, timeout, and useTCP.
Referenced by AgentFactory(), and init().

|
staticprivate |
References agentDesc, instantiateAgent(), and mailman.
Referenced by createAgent(), createAgent(), and instantiateAgent().

|
static |
Runs the input algorithm on the input problem.
| args | the problem file and the agent description file |
Test the simple mode.
Add a way to check the version number.
References AgentFactory(), frodo2.algorithms.test.AllTests.createRandProblem(), main(), outputFilePath, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), problem, timeout, and frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.toString().
Referenced by main(), and frodo2.algorithms.test.MASparserTest.testSampleSolve().

| void frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.controller.WhitePages.CONNECT_AGENT, frodo2.communication.MessageType.equals(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_REPORTING, nbrAgents, notifyIn(), pipe, pipes, and queue.
Referenced by notifyIn().

| boolean frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.outOfMemory | ( | ) |
true when the algorithm ran out of memory
|
private |
Parses the given problem.
| problemDesc | the problem in XCSP format |
| ClassNotFoundException | if the parser class was not found |
| NoSuchMethodException | if the parser does not have a constructor that takes in a Document |
| InvocationTargetException | if the parser constructor throws an exception |
| IllegalAccessException | if the parser constructor is not accessible |
| InstantiationException | if the parser class is abstract |
| IllegalArgumentException | if the argument to the parser constructor is illegal |
References frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), and parseProblem().
Referenced by AgentFactory(), and parseProblem().

|
static |
Prints the message statistics.
| msgNbrs | For each message type, the number of messages sent of that type |
| msgNbrsSentPerAgent | For each agent, the number of messages sent by that agent |
| msgNbrsReceivedPerAgent | For each agent, the number of messages received by that agent |
| msgSizes | For each message type, the total amount of information sent in messages of that type, in bytes |
| msgSizesSentPerAgent | For each agent, the total amount of information sent by that agent, in bytes |
| msgSizesReceivedPerAgent | For each agent, the total amount of information received by that agent, in bytes |
| maxMsgSizes | For each message type, the size (in bytes) of the largest message |
References maxMsgSizes, msgNbrs, msgNbrsReceivedPerAgent, msgNbrsSentPerAgent, msgSizes, msgSizesReceivedPerAgent, and msgSizesSentPerAgent.
| void frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.restart | ( | ProblemInterface< V, U > | problem | ) |
Restarts the algorithm on a new problem.
| problem | the new problem |
References agentDesc, AgentFactory(), agents, mailman, pipe, port, problem, frodo2.algorithms.AgentInterface< V extends Addable< V > >.report(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.reset(), restart(), statsToController, and waitForEnd().
Referenced by restart(), and frodo2.algorithms.AbstractSolver< P extends ProblemInterface< V, U, V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve().

| void frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
| boolean frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.timedOut | ( | ) |
true when the agent factory timed
|
private |
Waits for the algorithm to terminate.
References agents, done, frodo2.communication.mailer.CentralMailer.execute(), startTime, timedOut, timeout, and writeSol().
Referenced by restart().

|
private |
Writes the reported solution to the output file.
References frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getSolution(), and frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getUtility().
Referenced by waitForEnd().

|
private |
The agent configuration.
Referenced by AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), createAgent(), createAgent(), createAgent(), init(), instantiateAgent(), and restart().
|
private |
All agents, indexed by their IDs.
Referenced by end(), getCurrentSolution(), init(), restart(), and waitForEnd().
|
static |
The default timeout in milliseconds.
Referenced by frodo2.communication.mailer.CentralMailer.execute().
|
private |
Whether the agents have finished.
Referenced by waitForEnd().
|
private |
The nccc stamp of the AGENT_FINISHED message with the highest nccc stamp.
|
private |
The timestamp (in nanoseconds) of the AGENT_FINISHED message with the highest time stamp.
Referenced by getTime().
|
private |
The CentralMailer.
Referenced by createAgent(), end(), init(), instantiateAgent(), and restart().
|
private |
For each message type, the size (in bytes) of the largest message.
Referenced by printMsgStats().
|
private |
Whether to measure the number of messages and the total amount of information sent.
Referenced by AgentFactory(), and AgentFactory().
|
private |
Whether we should measure simulated time (true) or wall clock time (false).
Referenced by AgentFactory(), and AgentFactory().
|
private |
For each message type, the number of messages sent of that type.
Referenced by printMsgStats().
|
private |
For each agent, the number of messages received by that agent.
Referenced by getMsgNbrsReceivedPerAgent(), and printMsgStats().
|
private |
For each agent, the number of messages sent by that agent.
Referenced by getMsgNbrsSentPerAgent(), and printMsgStats().
|
private |
For each message type, the total amount of information sent in messages of that type, in bytes.
Referenced by printMsgStats().
|
private |
For each agent, the total amount of information received by that agent, in bytes.
Referenced by getMsgSizesReceivedPerAgent(), and printMsgStats().
|
private |
For each agent, the total amount of information sent by that agent, in bytes.
Referenced by getMsgSizesSentPerAgent(), and printMsgStats().
|
private |
Total number of agents.
Referenced by init(), and notifyIn().
|
private |
Number of agents finished.
|
private |
Used to synchronize access to nbrAgentsFinished.
|
private |
Used to track the number of various types of messages received from the agents.
|
private |
true when algorithm ran out of memory
|
private |
The path to the output file.
Referenced by AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), and main().
|
private |
The central listener's own pipe.
Referenced by init(), notifyIn(), and restart().
|
private |
For each agent, its input pipe.
Referenced by notifyIn().
|
staticprivate |
The TCP port used for the first agent, which gets incremented for each subsequent agent.
Referenced by createAgent(), createAgent(), init(), and restart().
|
private |
The problem.
Referenced by AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), init(), main(), and restart().
|
private |
The queue used to listen to the agents.
Referenced by end(), init(), notifyIn(), and setQueue().
|
private |
Whether information should be printed out.
Referenced by init().
|
private |
The solution collector.
|
private |
The start time of the algorithm, in milliseconds.
Referenced by waitForEnd().
|
private |
If true, stats should be sent to the controller; else, to the daemon.
Referenced by AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), createAgent(), init(), and restart().
|
private |
Each agent's subproblem.
Referenced by init().
|
private |
true when the agent factory timed out before all the agents finished
Referenced by waitForEnd().
|
private |
The timeout in milliseconds.
Referenced by AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), init(), main(), and waitForEnd().
|
private |
Whether to use TCP pipes or shared memory pipes.
Referenced by AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), AgentFactory(), and init().