|
CooperativeModel | makeSysAdminUniRing (unsigned agents, double pFailBase, double pFailBonus, double pDeadBase, double pDeadBonus, double pLoad, double pDoneG, double pDoneF) |
| This function creates a ring where each machine affects only the next adjacent one. More...
|
|
CooperativeModel | makeSysAdminBiRing (unsigned agents, double pFailBase, double pFailBonus, double pDeadBase, double pDeadBonus, double pLoad, double pDoneG, double pDoneF) |
| This function creates a ring where each machine affects the two adjacent ones. More...
|
|
std::string | printSysAdminRing (const State &s) |
| This function creates a graphical representation of a SysAdmin ring problem. More...
|
|
CooperativeModel | makeSysAdminGrid (unsigned width, unsigned height, double pFailBase, double pFailBonus, double pDeadBase, double pDeadBonus, double pLoad, double pDoneG, double pDoneF) |
| This function creates a grid where each machine is connected with its 4 neighbors. More...
|
|
CooperativeModel | makeSysAdminTorus (unsigned width, unsigned height, double pFailBase, double pFailBonus, double pDeadBase, double pDeadBonus, double pLoad, double pDoneG, double pDoneF) |
| This function creates a toroidal grid where each machine is connected with its 4 neighbors. More...
|
|
std::string | printSysAdminGrid (const State &s, unsigned width) |
| This function creates a graphical representation of a SysAdmin grid problem. More...
|
|
QFunction | bellmanBackup (const CooperativeModel &m, const ValueFunction &v) |
| This function applies a one-step backup on the input ValueFunction. More...
|
|
QFunction | makeQFunction (const DDNGraph &graph, const std::vector< std::vector< size_t >> &basisDomains) |
| This function creates a new factored QFunction from the given graph and basis domain. More...
|
|
Matrix2D | makeA0MatrixStatus (unsigned neighbors, size_t id, double pFailBase, double pFailBonus, double pDeadBase, double pDeadBonus) |
| This function builds the transition matrix for a single status state factor in the SysAdmin problem in case of action 0 (no-reboot). More...
|
|
Matrix2D | makeA1MatrixStatus () |
| This function builds the transition matrix for a single status state factor in the SysAdmin problem in case of action 1 (reboot). More...
|
|
Matrix2D | makeA0MatrixLoad (double pLoad, double pDoneG, double pDoneF) |
| This function builds the transition matrix for a single load state factor in the SysAdmin problem in case of action 1 (reboot). More...
|
|
Matrix2D | makeA1MatrixLoad () |
| This function builds the transition matrix for a single load state factor in the SysAdmin problem in case of action 1 (reboot). More...
|
|
Matrix2D | makeRewardMatrix (const Matrix2D &la0Matrix) |
| This function builds the reward function which is the same for all agents. More...
|
|
char | printMachineStatus (unsigned s) |
| This function returns a printable character of a machine's status. More...
|
|
char | printMachineLoad (unsigned l) |
| This function returns a printable character of a machine's load. More...
|
|
QFunction AIToolbox::Factored::MDP::makeQFunction |
( |
const DDNGraph & |
graph, |
|
|
const std::vector< std::vector< size_t >> & |
basisDomains |
|
) |
| |
This function creates a new factored QFunction from the given graph and basis domain.
The basisDomains is a set of state feature id groups. Each group should be unique.
For each such group, this function will identify the ids of the parent features and agents as defined by the input graph, and a new basis function is created inside the output QFunction. The parent features/agents ids are then set as the tags of a new basis function.
- Parameters
-
graph | The DDNGraph containing the information about the factored MDP structure. |
basisDomains | The required domains for each of the outputted basis functions of the QFunction. |
- Returns
- A newly built QFunction.
Matrix2D AIToolbox::Factored::MDP::makeRewardMatrix |
( |
const Matrix2D & |
la0Matrix | ) |
|
|
inline |
This function builds the reward function which is the same for all agents.
The parameter can be built using the makeA0MatrixLoad(double, double, double) function.
The reward matrix is all zero but for loaded states (since they are the only ones from which it is possible to complete a job).
We assume completing a job yelds 1.0 reward.
- Parameters
-
la0Matrix | The previously constructed transition matrix for the load factor. |
- Returns
- The reward matrix of size (3*3, 2).
CooperativeModel AIToolbox::Factored::MDP::makeSysAdminBiRing |
( |
unsigned |
agents, |
|
|
double |
pFailBase, |
|
|
double |
pFailBonus, |
|
|
double |
pDeadBase, |
|
|
double |
pDeadBonus, |
|
|
double |
pLoad, |
|
|
double |
pDoneG, |
|
|
double |
pDoneF |
|
) |
| |
This function creates a ring where each machine affects the two adjacent ones.
Note that pFailBonus and pDeadBonus are the total additional bonuses counted when all neighbors are faulty/dead, respectively. However, the bonuses are counted per-agent.
If a machine with 2 neighbors has a single faulty neighbor, it will get an additional failing probability of pFailBonus/2
. If the same machine has one faulty neighbor and one dead neighbor, it will get a penalty of pFailBonus/2 + pDeadBonus/2
.
- Parameters
-
agents | The number of agents in the ring. |
pFailBase | The base probability of a machine to fail. |
pFailBonus | The total additional probability to fail/die when all neighbors are faulty (counted per-neighbor). |
pDeadBase | The base probability of a faulty machine to die. |
pDeadBonus | The total additional probability to fail/die when all neighbors are dead (counted per-neighbor). |
pLoad | The probability of getting a job when idle. |
pDoneG | The probability of completing a job when good. |
pDoneF | The probability of completing a job when faulty. |
- Returns
- The CooperativeModel representing the problem.
CooperativeModel AIToolbox::Factored::MDP::makeSysAdminUniRing |
( |
unsigned |
agents, |
|
|
double |
pFailBase, |
|
|
double |
pFailBonus, |
|
|
double |
pDeadBase, |
|
|
double |
pDeadBonus, |
|
|
double |
pLoad, |
|
|
double |
pDoneG, |
|
|
double |
pDoneF |
|
) |
| |
This function creates a ring where each machine affects only the next adjacent one.
Note that pFailBonus and pDeadBonus are the total additional bonuses counted when all neighbors are faulty/dead, respectively. However, the bonuses are counted per-agent.
If a machine with 2 neighbors has a single faulty neighbor, it will get an additional failing probability of pFailBonus/2
. If the same machine has one faulty neighbor and one dead neighbor, it will get a penalty of pFailBonus/2 + pDeadBonus/2
.
- Parameters
-
agents | The number of agents in the ring. |
pFailBase | The base probability of a machine to fail. |
pFailBonus | The total additional probability to fail/die when all neighbors are faulty (counted per-neighbor). |
pDeadBase | The base probability of a faulty machine to die. |
pDeadBonus | The total additional probability to fail/die when all neighbors are dead (counted per-neighbor). |
pLoad | The probability of getting a job when idle. |
pDoneG | The probability of completing a job when good. |
pDoneF | The probability of completing a job when faulty. |
- Returns
- The CooperativeModel representing the problem.
std::string AIToolbox::Factored::MDP::printSysAdminGrid |
( |
const State & |
s, |
|
|
unsigned |
width |
|
) |
| |
This function creates a graphical representation of a SysAdmin grid problem.
Each agent is represented with 2 characters: the first represents the Status ('g'ood, 'f'aulty, 'd'ead), and the second represents the Load ('i'dle, 'l'oaded, 'd'one).
- Parameters
-
s | The State to represent. |
width | The number of agents for the width of the grid. |
- Returns
- A graphical representation to print on screen.
std::string AIToolbox::Factored::MDP::printSysAdminRing |
( |
const State & |
s | ) |
|
This function creates a graphical representation of a SysAdmin ring problem.
Each agent is represented with 2 characters: the first represents the Status ('g'ood, 'f'aulty, 'd'ead), and the second represents the Load ('i'dle, 'l'oaded, 'd'one).
- Parameters
-
- Returns
- A graphical representation to print on screen.