Пример #1
0
void Parallel::executeImpl(std::ostream& s, const GraphState &input) {
	if(getConfig().dg.calculateVerbose.get()) {
		s << indent << "parallel: " << strats.size() << " substrats" << std::endl;
		indentLevel++;
	}

	for(unsigned int i = 0; i < strats.size(); i++) {
		Strategy *strat = strats[i];
		if(getConfig().dg.calculateVerbose.get()) {
			s << indent << "substrat " << i << ":" << std::endl;
			indentLevel++;
		}
		strat->execute(s, input);
		if(getConfig().dg.calculateVerbose.get()) indentLevel--;
	}
	std::vector<const GraphState*> outputs;
	for(const Strategy *strat : strats) outputs.push_back(&strat->getOutput());
	output = new GraphState(outputs);
	output->sortUniverse(Graph::Single::nameLess);
	for(const GraphState::SubsetStore::value_type &vt : output->getSubsets()) {
		output->sortSubset(vt.first, Graph::Single::nameLess);
	}
	if(getConfig().dg.calculateVerbose.get()) indentLevel--;
}