BCESolve
|
This class handles the widgets for editing/displaying the game. More...
#include <bcegamehandler.hpp>
Signals | |
void | startSolveRoutine () |
Signals that the user has clicked the solve button. More... | |
void | cancelSolveRoutine () |
Signals that the user has clicked the cancel solve button. | |
Public Member Functions | |
BCEGameHandler (QWidget *parent) | |
Constructor. More... | |
~BCEGameHandler () | |
Destructor. More... | |
void | setGame (const BCEGame &_game) |
Replaces the current game with _game. More... | |
const BCEGame & | getGame () const |
Returns constant reference to the current game. | |
QVBoxLayout * | getLayout () const |
Returns the layout. | |
QPushButton * | getSolveButton () const |
Returns the solveButton. | |
QPushButton * | getCancelButton () const |
Returns the cancelButton. | |
void | setState (int state) |
Changes the current state. More... | |
const vector< double > | getWeightsOnObjectives () |
Returns weights on objectives. | |
const vector< vector< double > > | getMapBWeights () |
Returns weights on map boundary objectives. More... | |
const bool | getMapBoundaryOption () const |
Returns mapBoundaryOption. | |
const double | getMinAngleIncr () const |
Private Slots | |
void | currentStateChanged (int newS) |
Slot for changing the state. Calls setState. | |
void | stateAdded () |
Adds a new state. Calls changeNumberOfStates. | |
void | actionAdded (int player) |
Adds a new action for the indicated player. | |
void | typeAdded (int player) |
Adds a new type for the indicated player. | |
void | typeRemoved (int player) |
Removes a type for the indicated player. | |
void | objectiveAdded () |
Adds an objective to the game. | |
void | objectiveRemoved () |
Removes an objective from the game. | |
void | stateRemoved () |
Removes the current state. | |
void | actionRemoved (int player) |
Removes action for the given player. More... | |
void | nextState () |
Advances currentState to the next state. | |
void | prevState () |
Decreases currentState to the previous state. | |
void | emitSolveSignal () |
Emits the startSolveRoutine signal to BCEWindow. | |
void | clearCurrentGame () |
Clears the game currently displayed in the game tab. More... | |
void | setMBSolveOption () |
Solves the game and maps the boundary. | |
void | setMinAngleIncr (QString strValue) |
Sets the minimum angle increment to the provided value. | |
Private Member Functions | |
void | initializeModels () |
Delete old data models and create new ones. More... | |
void | changeNumberOfStates (int newS) |
Adds/removes models to achieve correct number of states. | |
void | setupLayout () |
Sets up the layout for the game handler. | |
Private Attributes | |
BCEGame | game |
The game object. More... | |
BCEPayoffTableModel * | payoffModel |
The model for interfacing with payoffs. | |
BCEPriorTableModel * | priorModel |
Model for interfacing with prior. | |
BCEConditionalTableModel * | conditionalModel |
Model for interfacing with conditional distribution of types. | |
BCEObjWeightsTableModel * | weightsModel |
Model for setting weights on main solver objectives. | |
BCEObjWeightsTableModel * | obj0WeightsModel |
Model for setting weights on objective0 for mapboundary. | |
BCEObjWeightsTableModel * | obj1WeightsModel |
Model for settings weights on objective1 for mapboundary. | |
bool | mapBoundaryOption |
Map Boundary option. More... | |
double | minAngleIncrement |
Minimum Angle increment, used for mapBoundary() More... | |
QVBoxLayout * | layout |
Layout for the game tab. | |
QPushButton * | solveButton |
Button that triggers solve routine. | |
QPushButton * | cancelButton |
Button that cancels solve. | |
QPushButton * | clearButton |
Button that clears currently displayed game. | |
QPushButton * | mapBoundaryButton |
Button handling map boundary solve option. | |
vector< QLineEdit * > | numActionsEdits |
Edits for number of actions. | |
QLineEdit * | numStatesEdit |
Edit for number of states. | |
vector< QLineEdit * > | numTypesEdits |
Edit for number of types. | |
QLineEdit * | numObjectivesEdit |
Edit for number of objectives. | |
QComboBox * | currentStateCombo |
Drop down menu for selecting a state. | |
BCETableView * | payoffTableView |
Table for displaying stage payoffs. | |
BCETableView * | priorTableView |
Table for displaying prior. | |
BCETableView * | conditionalTableView |
Table for displaying conditional distn of types. | |
BCETableView * | weightsTableView |
Table for displaying main solver weights data. | |
BCETableView * | obj0WeightsTableView |
Table for displaying mapBoundary objective0 weights data. | |
BCETableView * | obj1WeightsTableView |
Table for displaying mapBoundary objective1 weights data. | |
Friends | |
class | BCEPlotHandler |
This class handles the widgets for editing/displaying the game.
All of the widgets in the game tab and their slots are members of this class. It also contains the BCEGame and handles the interfaces to the game objects.
The class contains table models for editing the game, which interface with the respective data using the BCEGame class's interface methods.
The class also contains a table model for editing weights on several objectives. This data interfaces with BCESolverWorker, the class for solving custom games the user creates in the game tab.
BCEGameHandler::BCEGameHandler | ( | QWidget * | parent | ) |
Constructor.
Constructs edits and buttons, connects signals/slots, calls BCEGameHandler::initializeModels.
BCEGameHandler::~BCEGameHandler | ( | ) |
Destructor.
Destroys table views, models, etc.
|
privateslot |
Removes action for the given player.
Will remove the action that is currently selected in the payoff table, if one is selected. Otherwise, this function removes the last action for the player.
|
privateslot |
Clears the game currently displayed in the game tab.
Replaces the cleared game with a new game.
const vector< vector< double > > BCEGameHandler::getMapBWeights | ( | ) |
Returns weights on map boundary objectives.
This is a matrix of doubles. The first row gives the weights on objective0 for the mapBoundary algorithm. The second row gives the weights on objective1 for the algorithm.
|
private |
Delete old data models and create new ones.
Called in constructor and whenever game changes.
void BCEGameHandler::setGame | ( | const BCEGame & | _game | ) |
Replaces the current game with _game.
Calls initializeModels to reinitialize references for table models.
void BCEGameHandler::setState | ( | int | state | ) |
Changes the current state.
Switches all of the models over to new state and updates table views.
|
signal |
Signals that the user has clicked the solve button.
Contains map boundary option
|
private |
The game object.
This is the game that is represented in the game tab. Note that this can be a different game than the one that is associated with the solution in the solution tab. Alterations to the game can be saved using options in the file menu.
|
private |
Map Boundary option.
Tells the solver worker whether or not to map the boundary.
|
private |
Minimum Angle increment, used for mapBoundary()
Tells the solver what minimum angle increment to use when mapping the boundary.