Created
November 21, 2013 19:48
-
-
Save gidden/7588333 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @brief execute the full resource sequence | |
void Execute() { | |
// collect resource exchange information | |
ResourceExchange<T> exchng(ctx_); | |
exchng.AddAllRequests(); | |
exchng.AddAllBids(); | |
exchng.DoAllAdjustments(); | |
// translate graph | |
ExchangeTranslator<T> xlator(&exchng.ex_ctx()); | |
ExchangeGraph::Ptr graph = xlator.Translate(); | |
// solve graph | |
solver_->set_graph(graph.get()); | |
solver_->Solve(); | |
// get trades | |
std::vector< Trade<T> > trades; | |
xlator.BackTranslateSolution(graph->matches, trades); | |
std::for_each(trades.begin(), trades.end(), ExecuteTrade<T>); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment