示例#1
0
void dumpGraphImpl(const char *name, const GraphT &g, const ReportManager &rm) {
    typedef typename boost::graph_traits<GraphT>::vertex_descriptor VertexT;
    typedef typename boost::graph_traits<GraphT>::edge_descriptor EdgeT;
    ofstream os(name);
    NFAWriter<VertexT, EdgeT, GraphT> writer(g, rm);
    writeGraphviz(os, g, writer, get(&NFAGraphVertexProps::index, g));
}
示例#2
0
void dumpGraphImpl(const char *name, const GraphT &g,
                   const ue2::unordered_map<NFAVertex, u32> &region_map) {
    typedef typename boost::graph_traits<GraphT>::vertex_descriptor VertexT;
    typedef typename boost::graph_traits<GraphT>::edge_descriptor EdgeT;
    ofstream os(name);
    NFAWriter<VertexT, EdgeT, GraphT> writer(g, region_map);
    writeGraphviz(os, g, writer, get(&NFAGraphVertexProps::index, g));
}
示例#3
0
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
	: QMainWindow(parent, flags), gbw(nullptr), boardSize(5), redai(false),
	  redPlayerAgent(nullptr), whitePlayerAgent(nullptr), startBoard(5),
	  currentWorker(nullptr)
{
	setMinimumSize(400, 400);

	QMenuBar *mb = menuBar();
	QMenu* game = mb->addMenu("&Game");
	QMenu* size = game->addMenu("&New");
	connect(size, SIGNAL(triggered(QAction*)), this, SLOT(resetGame()));

	size->addAction("&Tiny", this, SLOT(tinyGame()));
	size->addAction("&Small", this, SLOT(smallGame()));
	size->addAction("&Medium", this, SLOT(mediumGame()));
	size->addAction("&Normal", this, SLOT(normalGame()));
	size->addAction("&Large", this, SLOT(largeGame()));

	game->addAction("&AI Versus", this, SLOT(AIGame()));

	game->addSeparator();
	game->addAction("&Quit", QApplication::instance(), SLOT(quit()), QKeySequence::Quit);

	QMenu* state = mb->addMenu("&State");

	state->addAction("&Forfeit move", this, SLOT(forfeitMove()));
	state->addSeparator();
	state->addAction("&Print History", this, SLOT(printGameHistory()));
	state->addAction("Write &Graph", this, SLOT(writeGraphviz()));
	state->addAction("Write &Image", this, SLOT(writeStateImage()));


	QMenu* help = mb->addMenu("&Help");
	help->addAction("&About Qt", QGuiApplication::instance(), SLOT(aboutQt()));

	statusLabel = new QLabel();
	statusBar()->addWidget(statusLabel);

	gbw = new GameBoardWidget(this);
	
	setCentralWidget(gbw);

	normalGame();

	setCurrentPlayer(T_RED);

	connect(gbw, SIGNAL(boardClicked(BoardIndex,BoardIndex)), this, SLOT(playerClick(BoardIndex,BoardIndex)));
}