SGSolve
|
Enhanced version of SGBaseAction. More...
#include <sgaction_pencilsharpening.hpp>
Public Member Functions | |
SGAction_PencilSharpening (const SGEnv &_env) | |
Constructor. More... | |
SGAction_PencilSharpening (const SGEnv &_env, int _state, int _action) | |
Constructor. More... | |
const vector< SGTuple > & | getTrimmedPoints () const |
Get method for trimmed points. | |
void | intersectRay (const SGPoint &pivot, const SGPoint &direction) |
Trims binding continuation segments. More... | |
void | intersectRaySegment (const SGPoint &pivot, const SGPoint &direction, int player) |
Static method to carry out trimming operations. More... | |
void | intersectRaySegment (const SGPoint &pivot, const SGPoint &direction, SGTuple &segment) |
Intersects the segment with the ray emanating from the pivot. | |
void | trim (const SGPoint &pivot, const SGPoint &direction) |
Trims the trimmedPoints using intersectRaySegment. | |
void | calculateMinIC (const SGGame &game, const vector< bool > &update, const SGTuple &threatTuple) |
Calculates the minimum incentive compatible continuation payoff. | |
void | updateTrim () |
Sets points equal to the trimmed points. | |
double | distToTrimmed () const |
Calculates sup norm distance between comparable points and trimmed points. | |
void | calculateBindingContinuations (const vector< bool > &updatedThreatTuple, const SGGame &game, const vector< SGTuple > &extremeTuples, const SGTuple &threatTuple, const SGTuple &pivot, const SGPoint ¤tDirection, int oldWest) |
Calculates binding continuation values. More... | |
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 |
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 the pencil sharpening algorithm and has been deprecated.
|
inline |
Constructor.
Constructs a null action associated with the given SGEnv.
|
inline |
Constructor.
Constructs an action for the given state and action index in the given environment.
void SGAction_PencilSharpening::calculateBindingContinuations | ( | const vector< bool > & | updatedThreatTuple, |
const SGGame & | game, | ||
const vector< SGTuple > & | extremeTuples, | ||
const SGTuple & | threatTuple, | ||
const SGTuple & | pivot, | ||
const SGPoint & | currentDirection, | ||
int | oldWest | ||
) |
Calculates binding continuation values.
This code is deprecated. Was part of the pencil sharpening algorithm.
|
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.
Trims binding continuation segments.
Intersects the binding continuation segments in SGAction::points with the half space that is below pivot in direction.getNormal().
void SGAction_PencilSharpening::intersectRaySegment | ( | const SGPoint & | pivot, |
const SGPoint & | direction, | ||
int | player | ||
) |
Static method to carry out trimming operations.
Intersects the action with the ray emanating from pivot in the given direction.
|
private |
Constant reference to the parent environment.
|
private |
Stores the "trimmed" points before updating.