Esempio n. 1
0
void Project::setModified(bool flag, bool files)
{
    if (!projectRoot.isEmpty()) {
        if (_isModified != flag) {
            emit modificationChanged(flag);
            _isModified = flag;
            if (files) {
                _filesModified = _isModified;
            }
            if (!_isModified) {
                currentDataFileIndex(currentDataFileIndex(),true);
                haveExtraArgs(haveExtraArgs(),true);
                extraArgs(extraArgs(),true);
                mzn2fznVerbose(mzn2fznVerbose(),true);
                mzn2fznOptimize(mzn2fznOptimize(),true);
                currentSolver(currentSolver(),true);
                n_solutions(n_solutions(),true);
                printAll(printAll(),true);
                defaultBehaviour(defaultBehaviour(),true);
                printStats(printStats(),true);
                haveSolverFlags(haveSolverFlags(),true);
                solverFlags(solverFlags(),true);
                n_threads(n_threads(),true);
                haveSeed(haveSeed(),true);
                seed(seed(),true);
                timeLimit(timeLimit(),true);
                solverVerbose(solverVerbose(),true);
            }
        }
    }
}
    std::vector<std::vector<std::string> > & getDescription()
    {
        if (_desc.size() == 0)
        {
            _desc.push_back(std::vector<std::string>());
            _desc.push_back(std::vector<std::string>());

            std::stringstream ss;

            _desc[0].push_back("Player Type:");
            _desc[0].push_back("Time Limit:");
            _desc[0].push_back("C Value:");
            _desc[0].push_back("Max Traversals:");
            _desc[0].push_back("Max Children:");
            _desc[0].push_back("Move Ordering:");
            _desc[0].push_back("Player To Move:");
            _desc[0].push_back("Opponent Model:");
			_desc[0].push_back("Move Selection:");

            ss << "Rave";                                                _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << timeLimit() << "ms";                                  _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << cValue();                                             _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << maxTraversals();                                      _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << maxChildren();                                        _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << MoveOrderMethod::getName(moveOrderingMethod());         _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << PlayerToMove::getName(playerToMoveMethod());            _desc[1].push_back(ss.str()); ss.str(std::string());
            ss << PlayerModels::getName(playerModel((maxPlayer()+1)%2));  _desc[1].push_back(ss.str()); ss.str(std::string());
			ss << UCTMoveSelect::getName(rootMoveSelectionMethod());  _desc[1].push_back(ss.str()); ss.str(std::string());
        }
        
        return _desc;
    }
	// actual call method
	Module::ReturnType VariableEmbeddingInserterUML::doCall(
		PlanRepLight              &pr,
		const Array<edge>         &origEdges,
		const EdgeArray<int>      *pCostOrig,
		const EdgeArray<__uint32> *pEdgeSubgraph)
	{
		VarEdgeInserterUMLCore core(pr, pCostOrig, pEdgeSubgraph);
		core.timeLimit(timeLimit());

		return core.call(origEdges, m_rrOption, m_percentMostCrossed);
	}
Esempio n. 4
0
	// actual call method
	Module::ReturnType FixedEmbeddingInserter::doCall(
		PlanRepLight &pr,
		const Array<edge> &origEdges,
		const EdgeArray<int> *pCostOrig,
		const EdgeArray<bool> *pForbiddenOrig,
		const EdgeArray<uint32_t> *pEdgeSubgraphs)
	{
		FixEdgeInserterCore core(pr, pCostOrig, pForbiddenOrig, pEdgeSubgraphs);
		core.timeLimit(timeLimit());

		ReturnType retVal = core.call(origEdges, m_keepEmbedding, m_rrOption, m_percentMostCrossed);
		m_runsPostprocessing = core.runsPostprocessing();
		return retVal;
	}
Esempio n. 5
0
// actual call method
Module::ReturnType VariableEmbeddingInserterDyn::doCall(
	PlanRepLight &pr,
	const Array<edge> &origEdges,
	const EdgeArray<int> *pCostOrig,
	const EdgeArray<bool> *pForbiddenOrig,
	const EdgeArray<uint32_t> *pEdgeSubgraphs)
{
	VarEdgeInserterDynCore core(pr, pCostOrig, pForbiddenOrig, pEdgeSubgraphs);
	core.timeLimit(timeLimit());

	ReturnType retVal = core.call(origEdges, removeReinsert(), percentMostCrossed());
	runsPostprocessing(core.runsPostprocessing());
	return retVal;
}
Esempio n. 6
0
void Project::checkModified()
{
    if (projectRoot.isEmpty() || _filesModified)
        return;
    if (currentDataFileIndex() != _currentDatafileIndex) {
        setModified(true);
        return;
    }
    if (haveExtraArgs() != _haveExtraArgs) {
        setModified(true);
        return;
    }
    if (extraArgs() != _extraArgs) {
        setModified(true);
        return;
    }
    if (mzn2fznVerbose() != _mzn2fzn_verbose) {
        setModified(true);
        return;
    }
    if (mzn2fznOptimize() != _mzn2fzn_optimize) {
        setModified(true);
        return;
    }
    if (currentSolver() != _currentSolver) {
        setModified(true);
        return;
    }
    if (n_solutions() != _n_solutions) {
        setModified(true);
        return;
    }
    if (printAll() != _printAll) {
        setModified(true);
        return;
    }
    if (defaultBehaviour() != _defaultBehaviour) {
        setModified(true);
        return;
    }
    if (printStats() != _printStats) {
        setModified(true);
        return;
    }
    if (haveSolverFlags() != _haveSolverFlags) {
        setModified(true);
        return;
    }
    if (solverFlags() != _solverFlags) {
        setModified(true);
        return;
    }
    if (n_threads() != _n_threads) {
        setModified(true);
        return;
    }
    if (haveSeed() != _haveSeed) {
        setModified(true);
        return;
    }
    if (seed() != _seed) {
        setModified(true);
        return;
    }
    if (timeLimit() != _timeLimit) {
        setModified(true);
        return;
    }
    if (solverVerbose() != _solverVerbose) {
        setModified(true);
        return;
    }
    setModified(false);
}