BCESolve
bcewindow.hpp
1// This file is part of the BCESolve library for games of incomplete
2// information
3// Copyright (C) 2022 Benjamin A. Brooks
4//
5// BCESolve free software: you can redistribute it and/or modify it
6// under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// BCESolve is distributed in the hope that it will be useful, but
11// WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13// General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see
17// <http://www.gnu.org/licenses/>.
18//
19// Benjamin A. Brooks
20// ben@benjaminbrooks.net
21// Chicago, IL
22
23#ifndef BCEWINDOW_HPP
24#define BCEWINDOW_HPP
25
26#include <QMainWindow>
27#include <QtWidgets>
28#include "bcegamehandler.hpp"
29#include "bceplothandler.hpp"
30#include "bceloghandler.hpp"
31#include "bcesolverworker.hpp"
32#include "hybridentryreserve.hpp"
33#include "commonvalueauction.hpp"
34#include "prisonervsbattle.hpp"
35#include "fpaknown.hpp"
36#include "fpaunknown.hpp"
37
39
47class BCEWindow : public QMainWindow
48{
49 Q_OBJECT;
50
51public:
53 BCEWindow(BCELogHandler &logHandler);
56 delete callback;
57 }
59 void displayAbout();
60
61signals:
62
64
68 void dataPathChanged(QString newPath);
71
72private:
73
81 QTabWidget *tabWidget;
83 QString path;
85
94
95private slots:
96
98
103 void loadSolution();
105 void loadGame();
107 void saveSolution();
109 void saveGame();
111 void runSolve();
113 void tabToSolution(BCESolution *soln,bool isBoundaryMapped);
115 /* The .png file name ending must be entered manually
116 upon saving for proper save action functionality.
117 */
118 void screenshot();
126 void displayException(QString message);
128 void conditionBCE(bool checked);
131
132};
133
134#endif
This class handles the widgets for editing/displaying the game.
Definition: bcegamehandler.hpp:56
Callback object to communicate with the gurobi solver.
Definition: bcegurobicallback.hpp:30
Log tab for the BCEViewer.
Definition: bceloghandler.hpp:37
This class handles all the plotting in the solution tab.
Definition: bceplothandler.hpp:46
Class for storing data produced by BCESolver.
Definition: bcesolution.hpp:64
Class for solving games created in the game tab.
Definition: bcesolverworker.hpp:45
Assembles BCEGameHandler, BCEPlotHandler, and BCELogHandler into a Unified GUI.
Definition: bcewindow.hpp:48
void displayAboutFromToolBar()
Displays about screen when requested in the toolbar.
Definition: bcewindow.cpp:597
void setCancelFlag()
Signals the callback object to cancel optimization.
BCEPlotHandler * solutionTab
Contains all information for the solution tab.
Definition: bcewindow.hpp:77
BCELogHandler * logTab
Pointer to the logTab in main.cpp.
Definition: bcewindow.hpp:79
QTabWidget * tabWidget
Widget holding layouts for game, solution, and log tabs.
Definition: bcewindow.hpp:81
void generateHybridAuction()
Starts the routine to build the common values default hybrid auction.
Definition: bcewindow.cpp:392
BCEGameHandler * gameTab
Contains all information for the game tab.
Definition: bcewindow.hpp:75
void displayException(QString message)
Displays exceptions signaled from other classes.
Definition: bcewindow.cpp:576
void conditionBCE(bool checked)
Toggles whether BCE heat map is conditional on state.
Definition: bcewindow.cpp:583
void displayAbout()
Displays "about" window.
Definition: bcewindow.cpp:587
void saveSolution()
Interacts with BCEGameHandler and BCEPlotHandler to save a solution.
Definition: bcewindow.cpp:254
QString screenShotPath
Default path to gui screenshots (*.png files).
Definition: bcewindow.hpp:87
void loadSolution()
Interacts with BCEPlotHandler to load new data.
Definition: bcewindow.cpp:172
void generateFirstPriceAuction()
Generates the first price auction with known values.
Definition: bcewindow.cpp:522
void tabToSolution(BCESolution *soln, bool isBoundaryMapped)
Switches the current tab to the solution tab.
Definition: bcewindow.cpp:377
BCEWindow(BCELogHandler &logHandler)
Constructor.
Definition: bcewindow.cpp:28
void generateCommonValueAuction()
Builds the default common values first price auction.
Definition: bcewindow.cpp:451
BCESolverWorker * solverWorker
solverWorker Object for Solving Games
Definition: bcewindow.hpp:91
void screenshot()
Takes a screenshot and opens a save file menu.
Definition: bcewindow.cpp:382
void saveGame()
Interacts with BCEGameHandler and BCEPlotHandler to save a game.
Definition: bcewindow.cpp:286
void runSolve()
Interacts with BCEGameHandler and BCESolverWorker to solve a game.
Definition: bcewindow.cpp:317
QThread * solverWorkerThread
Thread for solverWorker.
Definition: bcewindow.hpp:89
void dataPathChanged(QString newPath)
Sends path to example to BCEDataState.
void loadGame()
Interacts with BCEGameHandler and BCEPlotHandler to load a new game.
Definition: bcewindow.cpp:214
QString path
Default Path to data.
Definition: bcewindow.hpp:83
~BCEWindow()
Destructor.
Definition: bcewindow.hpp:55
BCEGurobiCallback * callback
Callback object for communicating with solver.
Definition: bcewindow.hpp:93