MultiAgentDecisionProcess  Release 0.2.1
MultiAgentDecisionProcess.cpp
Go to the documentation of this file.
1 
29 
30 using namespace std;
31 
32 #define DEBUG_MADP 0
33 
35  string name, string description, string pf) :
36  NamedDescribedEntity(name, description),
37  _m_nrAgents(nrAgents),
38  _m_problemFile(pf)
39 {
41 }
42 
44  string name, string description, string pf) :
45  NamedDescribedEntity(name, description),
46  _m_nrAgents(0),
47  _m_problemFile(pf)
48 {
50 }
51 
53 {
54  // strip everything before and including the last /
55  string unixName=_m_problemFile.substr(_m_problemFile.find_last_of('/') + 1);
56 
57  // and after the last .
58  _m_unixName=unixName.substr(0,unixName.find_last_of('.'));
59 }
60 
62 {
63  _m_problemFile.clear();
64 }
65 
67 {
68  return(_m_nrAgents);
69 }
70 
72 {
73  _m_nrAgents = nrAgents;
74  _m_agents.clear();
75  for(Index i = 0; i < nrAgents; i++)
76  _m_agents.push_back(Agent(i));
77 }
78 
80 {
81  _m_agents.push_back( Agent(_m_nrAgents++, name) );
82 }
83 
84 
86 {
87  return(_m_problemFile);
88 }
89 
91 {
92  stringstream ss;
93  ss << "Problem:"<< GetName()<< endl;
94  ss << "descr.:"<< GetDescription() << endl;
95  ss << "nrAgents=" << _m_nrAgents << endl;
96  ss << "problem file=" << _m_problemFile << endl;
97  return(ss.str());
98 }