SGSolve
|
Enhanced version of SGBaseAction. More...
#include <sgaction_maxminmax.hpp>
Public Member Functions | |
SGAction_MaxMinMax () | |
Default constructor. | |
SGAction_MaxMinMax (const SGEnv &_env) | |
Constructor. More... | |
SGAction_MaxMinMax (const SGEnv &_env, int _state, int _action) | |
Constructor. More... | |
SGAction_MaxMinMax (const SGEnv &_env, int _numPlayers, int _state, int _action) | |
Constructor. More... | |
void | resetTrimmedPoints () |
Resets the trimmed points for two players. More... | |
void | resetTrimmedPoints (const SGPoint &payoffUB) |
Resets the trimmed points for three players. More... | |
void | updateTrim () |
Sets points equal to the trimmed points. | |
double | distToTrimmed () const |
Calculates the distance between points and trimmedPoints in the sup norm. | |
bool | intersectHalfSpace (const SGPoint &normal, const double level, int player, SGTuple &segment, SGTuple &segmentDirs) |
Intersects the segment with a half space. | |
bool | intersectPolygonHalfSpace (const SGPoint &normal, const double level, int player, SGTuple &extPnts, SGTuple &extPntDirs) |
Intersects the IC polygon with a half space. | |
bool | trim (const SGPoint &normal, double level) |
Trims the trimmedPoints using intersectRaySegment. More... | |
void | mergeDuplicatePoints (const double tol) |
Merges duplicates up to the given tolerance. | |
void | calculateMinIC (const SGGame &game, const vector< bool > &update, const SGTuple &threatTuple) |
Calculates the minimum incentive compatible continuation payoff. | |
void | calculateMinIC (const SGGame &game, const SGTuple &threatTuple) |
Calculates the minimum incentive compatible continuation payoff. | |
const vector< SGTuple > & | getTrimmedPoints () const |
Get method for trimmed points. | |
const vector< SGTuple > & | getTrimmedBndryDirs () const |
Get method for trimmed points. | |
const SGPoint | getBndryDir (const int player, const int point) const |
Get boundary direction for 3 players. More... | |
bool | supportable () const |
Public Member Functions inherited from SGBaseAction | |
SGBaseAction () | |
Constructor. More... | |
SGBaseAction (int _state, int _action) | |
Constructor. More... | |
SGBaseAction (int _numPlayers, int _state, int _action) | |
Constructor. More... | |
~SGBaseAction () | |
Destructor. | |
bool | getIsNull () const |
Returns true if the action is null. | |
int | getAction () const |
Returns the action. | |
const vector< SGTuple > & | getPoints () const |
Returns the points array. | |
const vector< SGTuple > & | getBndryDirs () const |
Get method for bndry dirs. | |
const vector< vector< int > > & | getTuples () const |
Returns the tuples array. | |
int | getState () const |
Returns the state. | |
bool | hasCorner () const |
Returns whether or not the action has a corner. | |
const SGPoint & | getMinICPayoffs () const |
Returns the minimum IC continuation values. | |
const vector< SGTuple > & | getBindingContinuations () const |
Returns the array of binding continuation values. | |
void | setMinICPayoffs (const SGPoint &newMinIC) |
Sets the minimum IC continuation values. | |
void | setTuples (const vector< vector< int > > &newTuples) |
Sets the tuples array. | |
void | setPoints (const vector< SGTuple > &newPoints) |
Sets the points array | |
void | setPointsAndTuples (const vector< SGTuple > &newPoints, const vector< vector< int > > &newTuples) |
Sets the points and tuples arrays. | |
void | setCorner (bool tf) |
Sets the corner indicator. More... | |
bool | isCorner (const int p, const int k) const |
Returns whether or not the minimum IC payoff is feasible. | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serializes the action using the boost::serialization library. | |
Static Public Member Functions | |
static double | calculateMinIC (int action, int state, int player, const SGGame &game, const SGTuple &threatTuple) |
Calculates the IC constraint. More... | |
Private Attributes | |
const SGEnv * | env |
vector< SGTuple > | trimmedPoints |
vector< SGTuple > | trimmedBndryDirs |
Additional Inherited Members | |
Protected Attributes inherited from SGBaseAction | |
int | numPlayers |
int | state |
int | action |
SGPoint | minIC |
vector< SGTuple > | points |
vector< SGTuple > | bndryDirs |
vector< vector< int > > | tuples |
bool | isNull |
bool | corner |
Enhanced version of SGBaseAction.
Same functionality as SGBaseAction, but includes additional methods for computing payoffs and a reference to a parent SGEnv object to control parameters for the computation.
This class is used by SGSolver_MaxMinMax to implement the max-min-max algorithm.
|
inline |
Constructor.
Constructs a null action associated with the given SGEnv.
|
inline |
Constructor.
Grandfather in old two player code.
|
inline |
Constructor.
Constructs an action for the given state and action index in the given environment.
|
static |
Calculates the IC constraint.
Calculates the minimum incentive compatible expected continuation value for the given action, relative to the given threat tuple and for the given SGGame.
const SGPoint SGAction_MaxMinMax::getBndryDir | ( | const int | player, |
const int | point | ||
) | const |
Get boundary direction for 3 players.
< Returns the cross product of the boundary directions at the given point, i.e., the direction along an edge of the boundary that points into the feasible and IC region. Only works for three players.
void SGAction_MaxMinMax::resetTrimmedPoints | ( | ) |
Resets the trimmed points for two players.
< Sets the trimmed points to rays that point from the minimum incentive compatible continuation value along the positive coordinate axes.
void SGAction_MaxMinMax::resetTrimmedPoints | ( | const SGPoint & | payoffUB | ) |
Resets the trimmed points for three players.
< Sets the trimmed points to a large box in the coordinate plane between the minimum incentive compatible payoff and the payoff upper bound.
bool SGAction_MaxMinMax::trim | ( | const SGPoint & | normal, |
double | level | ||
) |
Trims the trimmedPoints using intersectRaySegment.
< Returns true if the action was actually trimmed.
|
private |
Pointer to the parent environment.
|
private |
Stores the boundary directions for the trimmed points.
|
private |
Stores the "trimmed" points before updating.