SGSolve
|
Reimplements SGPayoffTable model to specialize to probabilities. More...
#include <sgprobabilitytablemodel.hpp>
Public Member Functions | |
SGProbabilityTableModel (SGGame *_game, int _state, int _nextState) | |
Constructor. More... | |
QVariant | data (const QModelIndex &index, int role) const Q_DECL_OVERRIDE |
Reimplements the data method. More... | |
bool | setData (const QModelIndex &index, const QVariant &value, int role) |
Reimplements the setData method. More... | |
bool | setNextState (int newState) |
Sets nextState. | |
![]() | |
SGPayoffTableModel (SGGame *_game, int _state) | |
Constructor. | |
QVariant | data (const QModelIndex &index, int role) const Q_DECL_OVERRIDE |
Returns formatted data. More... | |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE |
Returns formatted header data. More... | |
bool | setData (const QModelIndex &index, const QVariant &value, int role) |
Sets data. More... | |
![]() | |
SGTableModel (SGGame *_game, int _state) | |
Constructor. | |
Qt::ItemFlags | flags (const QModelIndex &index) const |
Returns flags. More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const Q_DECL_OVERRIDE |
Returns the number of row player actions. | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const Q_DECL_OVERRIDE |
Returns the number of column player actions. | |
void | emitLayoutChanged () |
Emits layoutChanged signal. | |
bool | setState (int newState) |
Sets the state to newState. | |
Private Attributes | |
int | nextState |
Tomorrow's state. More... | |
Additional Inherited Members | |
![]() | |
int | state |
The state that the model is associated with. | |
SGGame * | game |
Pointer to the associated game. | |
Reimplements SGPayoffTable model to specialize to probabilities.
An SGSolutionHandler object contains one of these objects for each possible state tomorrow. The nextState member indicates which state this object is associated with.
|
inline |
Constructor.
Constructor takes an additional argument, which is the nextState whose transition probabilities this model will interface to.
QVariant SGProbabilityTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Reimplements the data method.
Retrieves the probability of going to nextState from state, when the action profile indicated by index is played. Retrieves the data using SGGame::getProbabilities.
bool SGProbabilityTableModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role | ||
) |
Reimplements the setData method.
Sets the transition probability from state to nextState to value, using SGGame::setProbability.
|
private |
Tomorrow's state.
This object interfaces with the probabilities of transitioning to nextState tomorrow.