11#include <boost/graph/adjacency_list.hpp>
12#include <boost/graph/adjacency_matrix.hpp>
13#include <boost/graph/labeled_graph.hpp>
14#include <boost/graph/copy.hpp>
15#include <boost/graph/graph_utility.hpp>
16#include <boost/graph/adj_list_serialize.hpp>
30#include <boost\unordered_set.hpp>
36#include <boost/serialization/split_member.hpp>
37#include <boost/serialization/unordered_map.hpp>
38#include <boost/serialization/vector.hpp>
39#include <boost/serialization/export.hpp>
40#include <boost/range/algorithm_ext/erase.hpp>
43#include <unordered_map>
57#include "boost/graph/graphviz.hpp"
76template <
class tvertexproperties,
class tedgeproperties>
79 friend class boost::serialization::access;
80 template<
class Archive>
81 void save(Archive& ar,
const unsigned int version)
const
83 ar & boost::serialization::make_nvp(
"FMTobject", boost::serialization::base_object<FMTobject>(*
this));
84 FMTobject::forcesave(ar, version);
85 ar & BOOST_SERIALIZATION_NVP(data);
86 ar & BOOST_SERIALIZATION_NVP(stats);
87 ar & BOOST_SERIALIZATION_NVP(buildtype);
89 template<
class Archive>
90 void load(Archive& ar,
const unsigned int version)
92 ar & boost::serialization::make_nvp(
"FMTobject", boost::serialization::base_object<FMTobject>(*
this));
93 FMTobject::forcesave(ar, version);
94 ar & BOOST_SERIALIZATION_NVP(data);
95 generatedevelopments();
96 ar & BOOST_SERIALIZATION_NVP(stats);
97 ar & BOOST_SERIALIZATION_NVP(buildtype);
99 BOOST_SERIALIZATION_SPLIT_MEMBER()
103 boost::bidirectionalS,
124 void updatevarsmap(std::map<
int,
double>& variables,const
int& var,const
double& coef)
const
127 std::map<int, double>::iterator varit = variables.find(var);
128 if (varit == variables.end())
130 variables[var] = coef;
133 varit->second += coef;
138 _exhandler->raisefromcatch(
"",
"FMTgraph::updatevarsmap", __LINE__, __FILE__);
143 typename std::vector<FMTvertex_pair>::iterator periodit = developments.begin();
145 if (!developments.empty())
148 boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data);
149 while (periodit!= developments.end()&&periodit->second==vertex_iterator_end)
156 "",
"FMTgraph::getfirstblock", __LINE__, __FILE__);
160 _exhandler->raisefromcatch(
"",
"FMTgraph::getfirstblock", __LINE__, __FILE__);
167 typename std::vector<FMTvertex_pair>::const_iterator periodit = developments.begin();
169 if (!developments.empty())
172 boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data);
173 while (periodit != developments.end() && periodit->second == vertex_iterator_end)
180 "Empty graph",
"FMTgraph::getfirstconstblock", __LINE__, __FILE__);
184 _exhandler->raisefromcatch(
"",
"FMTgraph::getfirstconstblock", __LINE__, __FILE__);
189 const int& theactionid,
bool& newedge)
const
193 if (boost::out_degree(descriptor, data) > 0)
196 for (boost::tie(outit, outend) = boost::out_edges(descriptor, data); outit != outend; ++outit)
206 "Action recursivity " + std::to_string(theactionid)+
" ",
"FMTgraph::isdependant", __LINE__, __FILE__);
214 _exhandler->raisefromcatch(
"",
"FMTgraph::isdependant", __LINE__, __FILE__);
234 buildtype(lbuildtype),
243 Core::FMTobject(rhs),
245 buildtype(rhs.buildtype),
250 generatedevelopments();
257 std::swap(stats,rhs.
stats);
273 generatedevelopments();
284 typename std::vector<FMTvertex_pair>::const_iterator devsit = this->getfirstconstblock();
286 while (devsit != developments.end())
290 if(((data[*developments.at(location).first].get())!= (rhs.
data[*rhs.
developments.at(location).first].get()) ||
291 (data[*developments.at(location).second].get()) != (rhs.
data[*rhs.
developments.at(location).second].get())))
305 _exhandler->raisefromcatch(
"",
"FMTgraph::operator==", __LINE__, __FILE__);
311 return (!(*
this == rhs));
315 std::vector<FMToutputnodecache<FMTvertex_descriptor FMT_COMMA FMTvertex_iterator>>().swap(nodescache);
319 std::vector<FMTvertex_pair>().swap(developments);
329 boost::unordered_set<Core::FMTlookup<FMTvertex_descriptor, Core::FMTdevelopment>>
getdevsset(
const int& period)
const
331 boost::unordered_set<Core::FMTlookup<FMTvertex_descriptor, Core::FMTdevelopment>> basedevs;
334 for (boost::tie(vertex_iterator, vertex_iterator_end) = developments.at(period); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
340 _exhandler->raisefromcatch(
"",
"FMTgraph::getdevsset", __LINE__, __FILE__);
351 std::queue<FMTvertex_descriptor>
initialize(
const std::vector<Core::FMTactualdevelopment>& actdevelopments)
353 std::queue<FMTvertex_descriptor>actives;
355 developments.clear();
356 const int startingperiod = actdevelopments.begin()->getperiod();
357 const int actualperiod = startingperiod+1;
360 boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data);
361 for (
int period = 0 ; period <= actualperiod;++period)
363 developments.push_back(
FMTvertex_pair(vertex_iterator_end,vertex_iterator_end));
365 const int constraint_id = -1;
367 const double proportion = 100;
370 std::vector<FMTvertex_descriptor>P0descriptors;
371 P0descriptors.reserve(actdevelopments.size());
376 P0descriptors.push_back(newvertex);
381 boost::unordered_set<Core::FMTlookup<FMTvertex_descriptor, Core::FMTdevelopment>> devsets;
388 actives.push(tovertex);
391 boost::add_edge(P0descriptors.at(poid), tovertex, newedge, data);
397 boost::tie(firstp0, vertex_iterator_end) = boost::vertices(data);
404 developments[actualperiod] =
FMTvertex_pair(lastone, vertex_iterator_end);
408 _exhandler->raisefromcatch(
"",
"FMTgraph::initialize", __LINE__, __FILE__);
420 std::queue<FMTvertex_descriptor> actives,
421 int compressageoperability=1)
426 const int actualperiod = getperiod();
429 boost::unordered_set<Core::FMTlookup<FMTvertex_descriptor, Core::FMTdevelopment>> actualdevs = getdevsset(actualperiod);
433 std::queue<FMTvertex_descriptor> new_actives;
434 while (!actives.empty())
441 bool doesnotgrow =
false;
442 if (active_development.
operable(action,model.
yields,&vertexinfo) &&
443 active_development.
getage()%compressageoperability==0)
445 bool gotaserie =
false;
446 if (gotseries && keepforserie(front_vertex,
447 (model.
actions.cbegin() + action_id),
454 new_actives.push(front_vertex);
457 if (gotaserie||action.
getname() ==
"_DEATH")
459 if (gotaserie && boost::out_degree(front_vertex, data) > 0)
462 std::string(front_properties.
get())+
463 " is on a serie for action "+action.
getname() +
" and have been already operated",
464 "FMTgraph::build", __LINE__, __FILE__);
469 addaction(action_id, statsdiff, new_actives, front_vertex, paths, actualdevs, gotseries);
473 new_actives.push(front_vertex);
477 actives = new_actives;
481 newstats = naturalgrowth(actives, statsdiff, typeIIforestmodel, gotseries);
485 _exhandler->raisefromcatch(
"",
"FMTgraph::build", __LINE__, __FILE__);
494 if (boost::in_degree(descriptor, data) == 1 &&
495 boost::out_degree(descriptor, data) == outcount)
502 const std::map<int, int>outsvar = getoutvariables(descriptor);
503 return (outsvar.find(-1) != outsvar.end());
509 _exhandler->raisefromcatch(
"",
"FMTgraph::isnotransfer", __LINE__, __FILE__);
524 boost::unordered_set<Core::FMTlookup<FMTvertex_descriptor, Core::FMTdevelopment>> nextperiods;
526 boost::tie(vertex_iterator, vertex_iterator_end) = developments.back();
527 lastoperated = vertex_iterator_end;
529 while (!actives.empty())
537 int variableindex = statsdiff.
cols;
538 double proportion = 100;
539 if ( (typeIImatrix && isnotransfer(front_vertex)))
541 variableindex = getinvariables(front_vertex).at(0);
542 proportion = getinproportion(front_vertex);
547 boost::add_edge(front_vertex, next_period, newedge, data);
551 developments.back() =
FMTvertex_pair(vertex_iterator, lastoperated);
552 developments.push_back(
FMTvertex_pair(lastoperated, vertex_iterator_end));
557 _exhandler->raisefromcatch(
"",
"FMTgraph::naturalgrowth", __LINE__, __FILE__);
559 return (statsdiff - stats);
565 std::vector<const Core::FMTdevelopment*>noactions;
568 for (boost::tie(vertexit, vertexend) = developments.at(getfirstperiod()); vertexit != vertexend; ++vertexit)
573 std::queue<FMTvertex_descriptor>tocheck;
575 for (edge_pair = boost::out_edges(*vertexit, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
578 tocheck.push(descriptor);
580 bool got_choice =
false;
581 while (!tocheck.empty() && !got_choice)
584 for (edge_pair = boost::out_edges(source_descritor, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
588 if (action_id != -1 && action_id != death_id)
594 tocheck.push(target_descriptor);
601 noactions.push_back(&base_dev);
608 _exhandler->raisefromcatch(
"",
"FMTgraph::nochoice", __LINE__, __FILE__);
616 void getvariablenames(
const std::vector<Core::FMTaction>& actions, std::vector<std::string>& colnames)
const
620 const std::string toremove =
"+-/*";
621 size_t verticies_id = 0;
622 for (boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data); vertex_iterator != vertex_iterator_end;++vertex_iterator)
625 const std::string vertexid =
"_V"+std::to_string(verticies_id);
626 boost::remove_erase_if(basename, boost::is_any_of(toremove));
628 for (boost::tie(outit, outend) = boost::out_edges(*vertex_iterator,data);outit!=outend;++outit)
630 std::string actionname =
"EVO";
631 const int variableid = data[*outit].getvariableID();
632 if (colnames.at(variableid).empty())
634 const int actionid = data[*outit].getactionID();
637 actionname = actions.at(actionid).getname();
639 colnames[variableid] = basename + actionname + vertexid;
647 _exhandler->raisefromcatch(
"",
"FMTgraph::getvariablenames", __LINE__, __FILE__);
696 const std::string toremove =
"+-/*";
697 size_t verticies_id = 0;
698 for (boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
700 const int rowid = data[*vertex_iterator].getconstraintID();
703 const std::string vertexid =
"_V" + std::to_string(verticies_id);
705 boost::remove_erase_if(name, boost::is_any_of(toremove));
706 rownames[rowid] = name + vertexid;
713 _exhandler->raisefromcatch(
"",
"FMTgraph::gettransferrownames", __LINE__, __FILE__);
718 std::vector<Core::FMTactualdevelopment>
getperiodstopdev(
const int location,
const double* actual_solution)
const
720 std::vector<Core::FMTactualdevelopment>all_period_stop_devs;
723 for (boost::tie(vertexit, vertexend) = developments.at(location); vertexit != vertexend; ++vertexit)
725 if (periodstop(*vertexit))
727 const double area = inarea(*vertexit, actual_solution);
735 _exhandler->raisefromcatch(
"",
"FMTgraph::getperiodstopdev", __LINE__, __FILE__);
737 return all_period_stop_devs;
744 std::vector<std::string>target_attributes;
745 std::map<std::string, double>results;
761 target_attributes.push_back(
"Total");
762 for (
const std::string& attribute : target_attributes)
764 results[attribute] = 0;
767 std::vector<std::string> equation;
772 const std::map<std::string, double> srcvalues = getsource(model, output_node, period, targettheme, solution, level);
775 for (std::map<std::string, double>::const_iterator mit = srcvalues.begin(); mit != srcvalues.end(); mit++)
777 if (results.find(mit->first) == results.end())
779 results[mit->first] = 0;
781 results[mit->first] += mit->second;
785 for (
const std::string& attribute : target_attributes)
787 results[attribute] += srcvalues.at(attribute);
792 std::map<std::string, std::vector<std::string>>allequations;
793 const std::vector<Core::FMToutputnode> allnodes = output.
getnodes(equation,1,
false,period);
796 if (allnodes.empty())
801 "Cannot get level values by developement",
802 "FMTgraph::getoutput", __LINE__, __FILE__);
804 allequations[
"Total"] = equation;
810 const std::map<std::string, double> srcvalues = getsource(model, output_node, period, targettheme, solution, level);
811 output_node.fillupequation(allequations, srcvalues, equation, outid);
821 _exhandler->raisefromcatch(
"For output: "+std::string(output),
"FMTgraph::getoutput", __LINE__, __FILE__);
831 return alldevs.find(tofind)->memoryobject;
835 return data[descriptor].get();
841 if (!this->containsdevelopment(futurdevelopement, alldevs)||forcenewone)
843 const int constraint_id = -1;
853 _exhandler->raisefromcatch(
"",
"FMTgraph::adddevelopment", __LINE__, __FILE__);
855 return getdevelopment(futurdevelopement, alldevs);
862 const int constraint_id = -1;
864 newvertex = boost::add_vertex(properties, data);
868 _exhandler->raisefromcatch(
"",
"FMTgraph::adddevelopment", __LINE__, __FILE__);
874 size_t hash(
size_t seed = 0)
const
877 boost::hash_combine(seed, boost::hash<Core::FMTdevelopment>()(data[*developments.at(0).first].get()));
879 for (boost::tie(edge_iterator, edge_iterator_end) = boost::edges(data); edge_iterator != edge_iterator_end; ++edge_iterator)
887 _exhandler->raisefromcatch(
"",
"FMTgraph::hash", __LINE__, __FILE__);
894 std::queue<FMTvertex_descriptor>& actives,
896 const std::vector<Core::FMTdevelopmentpath>& paths,
898 bool inserie =
false)
904 bool newchoice =
false;
909 if (!this->containsdevelopment(*devpath.development,devsets))
912 tovertex = this->adddevelopment(*devpath.development,devsets);
913 actives.push(tovertex);
916 tovertex = this->adddevelopment(*devpath.development, devsets);
917 if (inserie||isdependant(tovertex, actionID, newedge))
919 tovertex = this->adddevelopment(*devpath.development, devsets,
true);
920 actives.push(tovertex);
926 boost::add_edge(out_vertex, tovertex, newedge, data);
939 _exhandler->raisefromcatch(
"",
"FMTgraph::addaction", __LINE__, __FILE__);
944 std::queue<FMTvertex_descriptor>& actives,
946 const std::vector<Core::FMTdevelopmentpath>& paths)
949 int variable_id = statsdiff.
cols;
951 std::vector<FMTvertex_descriptor>active_vertex;
956 actives.push(tovertex);
957 boost::add_edge(out_vertex, tovertex, newedge, data);
963 _exhandler->raisefromcatch(
"",
"FMTgraph::addaction", __LINE__, __FILE__);
969 const int& actionID,
const double*& solution)
const
975 for (boost::tie(outedge_iterator, outedge_end) = boost::out_edges(out_vertex, data); outedge_iterator != outedge_end; ++outedge_iterator)
988 _exhandler->raisefromcatch(
"",
"FMTgraph::outarea", __LINE__, __FILE__);
997 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1002 return boost::source(*inedge_iterator, data);
1007 _exhandler->raisefromcatch(
"",
"FMTgraph::getgrowthsource", __LINE__, __FILE__);
1014 std::vector<FMTvertex_descriptor> vsources;
1017 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1022 vsources.push_back(boost::source(*inedge_iterator, data));
1027 _exhandler->raisefromcatch(
"",
"FMTgraph::getactionsources", __LINE__, __FILE__);
1033 const double*& solution,
int actionid = -1,
bool growth =
false)
const
1038 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1041 if (edgeprop.
getactionID() == actionid || !growth)
1048 _exhandler->raisefromcatch(
"",
"FMTgraph::inarea", __LINE__, __FILE__);
1056 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1067 _exhandler->raisefromcatch(
"",
"FMTgraph::periodstart", __LINE__, __FILE__);
1075 if (boost::in_degree(out_vertex, data) == 1)
1078 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1090 _exhandler->raisefromcatch(
"",
"FMTgraph::onlypertiodstart", __LINE__, __FILE__);
1101 for (boost::tie(vertexit, vertexend) = developments.at(period);vertexit!=vertexend;++vertexit)
1111 _exhandler->raisefromcatch(
"",
"FMTgraph::getmaximalock", __LINE__, __FILE__);
1125 for (boost::tie(outedge_iterator, outedge_end) = boost::out_edges(out_vertex, data); outedge_iterator != outedge_end; ++outedge_iterator)
1136 _exhandler->raisefromcatch(
"",
"FMTgraph::periodstop", __LINE__, __FILE__);
1141 const int& actionID)
const
1143 std::vector<Core::FMTdevelopmentpath>paths;
1145 for (
FMToutedge_pair edge_pair = boost::out_edges(out_vertex, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
1157 _exhandler->raisefromcatch(
"",
"FMTgraph::getpaths", __LINE__, __FILE__);
1164 if (
static_cast<int>(developments.size()) > period)
1175 _exhandler->raisefromcatch(
"",
"FMTgraph::isvalidouputnode", __LINE__, __FILE__);
1182 const Core::FMToutputnode& node,
const std::vector<const Core::FMTaction*>& selected)
const
1191 (((buildtype == FMTgraphbuild::schedulebuild) && development.
anyoperable(selected, model.
yields, &getvertextoyieldinfo(model, vertex_descriptor))) ||
1202 _exhandler->raisefromcatch(
"",
"FMTgraph::isvalidgraphnode", __LINE__, __FILE__);
1208 std::map<int, double>emptyreturn;
1211 const std::vector<FMTvertex_descriptor>verticies = getnode(model, tempnode, period);
1212 return getvariables(model, tempnode, verticies);
1216 _exhandler->raisefromcatch(
"",
"FMTgraph::locatenode", __LINE__, __FILE__);
1223 std::map<std::string,std::map<int,double>> variablesreturn;
1226 const std::vector<FMTvertex_descriptor>verticies = getnode(model, output_node, period);
1230 variablesreturn[
"~nothemetargetid~"]=getvariables(model, output_node, verticies);
1233 std::map<std::string,std::vector<FMTvertex_descriptor>> orderedtarget;
1234 for (
const auto& vert : verticies)
1238 if(orderedtarget.find(value)==orderedtarget.end())
1240 orderedtarget[value]=std::vector<FMTvertex_descriptor>();
1242 orderedtarget[value].push_back(vert);
1244 for (
const auto& odtar:orderedtarget)
1246 variablesreturn[odtar.first]=getvariables(model,output_node,odtar.second);
1253 _exhandler->raisefromcatch(
"",
"FMTgraph::locatenodebytheme", __LINE__, __FILE__);
1255 return variablesreturn;
1260 std::vector<FMTvertex_descriptor>locations;
1262 std::vector<int>targetedperiods;
1263 const int maxperiod =
static_cast<int>(developments.size() - 2);
1264 const int node_period = output_node.
settograph(targetedperiods, period, maxperiod);
1266 if (node_period < 0)
1273 std::vector<const Core::FMTaction*> selected;
1275 if (isvalidouputnode(model, output_node, selected, node_period))
1279 if (nodescache.empty())
1281 nodescache.reserve(developments.size());
1284 const bool gotstaticnode = model.
isstaticnode(output_node);
1285 for (
const int& localnodeperiod : targetedperiods)
1287 std::vector<FMTvertex_descriptor>
const* descriptors =
nullptr;
1288 std::vector<FMTvertex_descriptor>staticdescriptors;
1289 bool exactverticies =
false;
1293 staticdescriptors = getnodebystaticmask(model, output_node, localnodeperiod);
1294 descriptors = &staticdescriptors;
1296 while (nodescache.size() != developments.size())
1298 const size_t devindex = nodescache.size();
1299 nodescache.emplace_back(developments.at(devindex).first, developments.at(devindex).second);
1301 descriptors = &nodescache.at(localnodeperiod).getverticies(output_node, model.
actions, model.
themes, exactverticies);
1306 locations.reserve(locations.size() + descriptors->size());
1307 locations.insert(locations.end(), descriptors->begin(), descriptors->end());
1309 std::vector<FMTvertex_descriptor>periodlocations;
1314 if (isvalidgraphnode(model, potential, output_node, selected))
1316 locations.push_back(potential);
1317 periodlocations.push_back(potential);
1321 std::sort(periodlocations.begin(), periodlocations.end());
1324 nodescache.at(localnodeperiod).setvalidverticies(output_node, periodlocations);
1336 _exhandler->raisefromcatch(
"",
"FMTgraph::getnode", __LINE__, __FILE__);
1338 std::sort(locations.begin(), locations.end());
1344 return std::map<int, double>();
1349 if (!actionsop.empty())
1352 for (edge_pair = boost::out_edges(descriptor, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
1356 if (actionid >= 0 && actionsop.at(actionid))
1376 if (!action_ids.empty())
1378 std::map<int, int> variables = getoutvariables(descriptor);
1379 for (
const int&
id : action_ids)
1381 if (variables.find(
id) != variables.end())
1390 _exhandler->raisefromcatch(
"",
"FMTgraph::anyoperables", __LINE__, __FILE__);
1396 std::vector<int>invars;
1399 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1408 _exhandler->raisefromcatch(
"",
"FMTgraph::getinvariables", __LINE__, __FILE__);
1415 std::vector<double>inprops;
1418 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1427 _exhandler->raisefromcatch(
"",
"FMTgraph::getinproportions", __LINE__, __FILE__);
1434 std::map<int, int> mapping;
1437 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
1447 _exhandler->raisefromcatch(
"",
"FMTgraph::getinidsvariables", __LINE__, __FILE__);
1454 std::map<int, int> mapping;
1457 for (edge_pair = boost::out_edges(out_vertex, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
1466 _exhandler->raisefromcatch(
"",
"FMTgraph::getoutvariables", __LINE__, __FILE__);
1475 std::vector<int>actions;
1477 const size_t outsize = boost::out_degree(out_vertex, data);
1480 actions.reserve(outsize - 1);
1482 for (edge_pair = boost::out_edges(out_vertex, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
1486 if ((actionid) >= 0)
1488 actions.emplace_back(
static_cast<int>(actionid));
1491 std::sort(actions.begin(), actions.end());
1496 _exhandler->raisefromcatch(
"",
"FMTgraph::getoutactions", __LINE__, __FILE__);
1502 std::vector<const Core::FMTaction*>selected;
1504 if (!action_IDS.empty())
1506 selected.resize(action_IDS.size());
1508 for (
const int & actid : action_IDS)
1510 selected[aid] = &model.
actions[actid];
1516 _exhandler->raisefromcatch(
"",
"FMTgraph::selectedactions", __LINE__, __FILE__);
1523 int constraintlower = constraint.getperiodlowerbound();
1524 if (constraintlower == std::numeric_limits<int>::max())
1526 constraintlower =
static_cast<int>((developments.size() - 2));
1530 start = std::max(constraintlower, getfirstperiod());
1531 stop =
static_cast<int>((constraint.getperiodupperbound() >
static_cast<int>((developments.size() - 2))) ? (developments.size() - 2) : constraint.getperiodupperbound());
1532 if (constraint.acrossperiod())
1539 _exhandler->raisefromcatch(
"",
"FMTgraph::constraintlenght", __LINE__, __FILE__);
1541 return (start <
static_cast<int>(developments.size()) && start <= stop);
1557 std::queue<FMTvertex_descriptor> actives,
1564 const int actualperiod = getperiod();
1565 boost::unordered_set<Core::FMTlookup<FMTvertex_descriptor, Core::FMTdevelopment>> actualdevs = getdevsset(actualperiod);
1569 if (schedule.
find(action) != schedule.
end())
1571 std::queue<FMTvertex_descriptor> new_actives;
1572 while (!actives.empty())
1579 if ((((schedule.
at(action)).find(active_development) != (schedule.
at(action)).end()) ||
1581 (schedule.
at(action)).find(active_development.
clearlock()) != (schedule.
at(action)).end())))
1584 if (active_development.
operable(action, model.
yields, &vertexinfo))
1586 if (action.
getname() ==
"_DEATH")
1590 const std::vector<Core::FMTdevelopmentpath> paths = active_development.
operate(action, model.
transitions[action_id], model.
yields, model.
themes);
1591 addaction(action_id, statsdiff, new_actives, front_vertex, paths, actualdevs);
1596 new_actives.push(front_vertex);
1599 actives = new_actives;
1606 _exhandler->raisefromcatch(
"",
"FMTgraph::buildschedule", __LINE__, __FILE__);
1609 return naturalgrowth(actives, statsdiff,typeIIforestmodel);
1615 std::vector<int>&deletedvariables,
1616 bool keepbounded =
false)
1623 return developments.empty();
1628 std::queue<FMTvertex_descriptor>actives;
1631 for (boost::tie(vertexit, vertexend) = developments.back(); vertexit != vertexend; ++vertexit)
1633 actives.push(*vertexit);
1638 _exhandler->raisefromcatch(
"",
"FMTgraph::getactiveverticies", __LINE__, __FILE__);
1646 return developments.at(period);
1660 return developments.size();
1667 std::vector<int>&row_starts,
1668 std::vector<int>& cols,
1669 std::vector<double>& cols_value)
const
1673 void getinitialbounds(std::vector<double>& lower_bounds, std::vector<double>& upper_bounds)
const
1678 for (boost::tie(vertex_iterator, vertex_iterator_end) = developments.at(getfirstactiveperiod()); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
1682 const std::map<int, int>outs = getoutvariables(descriptor);
1683 lower_bounds[outs.at(-1)] = vproperty.
getbaseRHS();
1684 upper_bounds[outs.at(-1)] = vproperty.
getbaseRHS();
1689 _exhandler->raisefromcatch(
"",
"FMTgraph::getinitialbounds", __LINE__, __FILE__);
1694 return boost::num_edges(data);
1701 std::vector<FMTvertex_descriptor>descriptors;
1705 for (boost::tie(vertex_iterator, vertex_iterator_end)=getperiodverticies(period); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
1710 descriptors.push_back(*vertex_iterator);
1749 _exhandler->raisefromcatch(
"For node: " + std::string(node),
"FMTgraph::getnodebystaticmask", __LINE__, __FILE__);
1760 std::map<std::string, double>emptyreturn;
1763 const std::vector<FMTvertex_descriptor>verticies = getnode(model, tempnode, period);
1764 return getvalues(model, verticies, tempnode, theme, solution, level);
1767 _exhandler->raisefromcatch(
"For node: "+std::string(node),
"FMTgraph::getsource", __LINE__, __FILE__);
1778 _exhandler->raisefromcatch(
"",
"FMTgraph::getvertextoyieldinfo", __LINE__, __FILE__);
1790 _exhandler->raisefromcatch(
"",
"FMTgraph::getvertexfromvertexinfo", __LINE__, __FILE__);
1802 std::map<std::string, double>values;
1808 values[attribute] = 0;
1813 values[
"Total"] = 0;
1815 if (!verticies.empty())
1833 value = std::string(data[getgrowthsource(vertex)].get());
1835 value = std::string(development);
1851 area = outarea(vertex, -1, solution);
1856 values[value] += coef * area;
1861 double action_value = 0;
1862 const int actionID =
static_cast<int>(std::distance(&(*model.
actions.begin()), act));
1863 const std::vector<Core::FMTdevelopmentpath>paths = getpaths(vertex, actionID);
1865 action_value = action_coef * (outarea(vertex, actionID, solution));
1866 values[value] += action_value;
1875 for (
auto valit : values)
1877 total += valit.second;
1879 values[
"Total"] = total;
1884 _exhandler->raisefromcatch(
"For node: "+std::string(node)+
" on theme "+std::string(theme),
"FMTgraph::getvalues", __LINE__, __FILE__);
1892 boost::tie(vertex, vend) = vertices(data);
1894 return (data[*vend].get().getperiod());
1897 _exhandler->raisefromcatch(
"",
"FMTgraph::getperiod", __LINE__, __FILE__);
1905 for (
size_t nodecacheid = 0; nodecacheid < nodescache.size(); ++nodecacheid)
1907 nodescache[nodecacheid].rebase(developments.at(nodecacheid).first,developments.at(nodecacheid).second);
1912 _exhandler->raisefromcatch(
"",
"FMTgraph::rebasecache", __LINE__, __FILE__);
1921 developments.clear();
1924 boost::tie(base_iterator, base_iterator_end) = boost::vertices(data);
1925 if (base_iterator!= base_iterator_end)
1927 developments.resize(getperiod() + 1,
FMTvertex_pair(base_iterator_end, base_iterator_end));
1929 int actualperiod = 0;
1930 size_t vertexid = 0;
1932 for (boost::tie(vertex, vend) = boost::vertices(data); vertex != vend; ++vertex)
1936 const size_t period_location = (dev.
getperiod());
1939 firstvertex = vertex;
1944 developments[period_location - 1] =
FMTvertex_pair(firstvertex, vertex);
1945 firstvertex = vertex;
1950 developments.back() =
FMTvertex_pair(firstvertex, base_iterator_end);
1955 _exhandler->raisefromcatch(
"",
"FMTgraph::generatedevelopments", __LINE__, __FILE__);
1960 bool different =
false;
1964 boost::tie(thisedge_iterator, thisedge_iterator_end) = boost::edges(data);
1965 boost::tie(rhsedge_iterator, rhsedge_iterator_end) = boost::edges(rhs.
data);
1966 while (!different && thisedge_iterator != thisedge_iterator_end && rhsedge_iterator != rhsedge_iterator_end)
1974 ++thisedge_iterator;
1979 _exhandler->raisefromcatch(
"",
"FMTgraph::sameedgesas", __LINE__, __FILE__);
1984 const std::vector<int>& removedconstraints)
1990 return static_cast<int>(std::distance(developments.begin(), getfirstconstblock()));
1997 std::queue<FMTinedge_iterator>actives;
1998 actives.push(activeedge);
1999 while (!actives.empty())
2001 activeedge = actives.front();
2004 if (data[*activeedge].getactionID() >= 0)
2006 periodtolastdisturbance = data[vertexsource].get().getperiod();
2010 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(vertexsource, data); inedge_iterator != inedge_end; ++inedge_iterator)
2012 actives.push(inedge_iterator);
2015 lastedge = activeedge;
2018 _exhandler->raisefromcatch(
"",
"FMTgraph::getlastdisturbance", __LINE__, __FILE__);
2024 void filluplastactions(
const int& targetperiod,
const FMTvertex_descriptor& targetdescriptor,std::vector<const FMTbaseedgeproperties*>& lastactions, std::vector<int>& distances,
const size_t& depth)
const
2027 std::queue<FMTvertex_descriptor>activevertex;
2028 activevertex.push(targetdescriptor);
2029 while (!activevertex.empty()&&lastactions.size() <= depth)
2034 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(descriptor, data); inedge_iterator != inedge_end; ++inedge_iterator)
2038 activevertex.push(sourcevertex);
2039 const int sourceperiod = data[sourcevertex].get().getperiod();
2042 lastactions.push_back(&inedgeproperties);
2043 distances.push_back(targetperiod - sourceperiod);
2045 if (sourceperiod == 0 && lastactions.size() <= depth)
2047 lastactions.push_back(
nullptr);
2048 distances.push_back(targetperiod-1 + data[sourcevertex].get().getage());
2055 _exhandler->raisefromcatch(
"",
"FMTgraph::filluplastactions", __LINE__, __FILE__);
2067 std::vector<FMTvertex_descriptor>paths;
2072 if (containsdevelopment(*path.development, actualperioddevs))
2074 paths.push_back(getdevelopment(*path.development, actualperioddevs));
2081 for (edge_pair = boost::out_edges(act, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
2086 paths.push_back(boost::target(*edge_pair.first, data));
2094 int period = getdevelopment(path).getperiod();
2096 while (period < size())
2098 std::map<int, int>vars = getoutvariables(vdescriptor);
2100 amount += vars.size();
2103 for (edge_pair = boost::out_edges(vdescriptor, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
2108 vdescriptor = boost::target(*edge_pair.first, data);
2123 _exhandler->printexceptions(
"for " + std::string(dev),
"FMTgraph::getamountofpaths", __LINE__, __FILE__);
2128 std::vector<Core::FMTaction>::const_iterator theaction,
2129 const size_t& seriemaxsize,
const std::vector<Core::FMTaction>& actions)
const
2133 const std::vector<std::string> targetserie = getactionserie(targetdescriptor, seriemaxsize, actions);
2134 for (std::vector<Core::FMTaction>::const_iterator acit = theaction;acit!= actions.cend();++acit)
2136 if (acit->ispartofaserie()&& acit->isallowedinserie(targetserie))
2144 _exhandler->printexceptions(
"",
"FMTgraph::getactionserie", __LINE__, __FILE__);
2146 return actions.cend();
2150 std::vector<Core::FMTaction>::const_iterator theaction,
2151 const size_t& seriemaxsize,
2152 const std::vector<Core::FMTaction>& actions,
2153 bool& onserie)
const
2156 std::vector<Core::FMTaction>::const_iterator acit = getactionoffirstserie(targetdescriptor, theaction, seriemaxsize,actions);
2157 if (acit == actions.end())
2161 else if (acit == theaction)
2173 _exhandler->printexceptions(
"",
"FMTgraph::keepforserie", __LINE__, __FILE__);
2180 const size_t& maxactions,
const std::vector<Core::FMTaction>& actions)
const
2183 std::vector<std::string>theserie;
2185 size_t inedgessize = boost::in_degree(targetdescriptor,data);
2186 while (inedgessize>0 && theserie.size()<maxactions)
2188 if (inedgessize > 0)
2190 if (inedgessize > 1)
2193 std::string actions;
2194 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(targetdescriptor, data); inedge_iterator != inedge_end; ++inedge_iterator)
2197 actions += std::to_string(inedgeproperties.
getactionID())+
" ";
2201 "Developement " + std::string(targetproperties.
get()) +
" has " + std::to_string(inedgessize) +
" in edges ("+actions+
")",
2202 "FMTgraph::getactionserie", __LINE__, __FILE__);
2205 boost::tie(inedge_iterator, inedge_end) = boost::in_edges(targetdescriptor, data);
2207 const int actionid = inedgeproperties.
getactionID();
2210 theserie.insert(theserie.begin(), actions.at(actionid).getname());
2212 targetdescriptor = boost::source(*inedge_iterator, data);
2213 inedgessize = boost::in_degree(targetdescriptor, data);
2218 _exhandler->printexceptions(
"",
"FMTgraph::getactionserie", __LINE__, __FILE__);
2226 std::set<Core::FMTSerie>theseries;
2228 size_t inedgessize = boost::in_degree(targetdescriptor, data);
2230 const int startperiod = mainproperties.
get().
getperiod();
2231 std::string actualserie(seriestarter);
2234 while (inedgessize > 0)
2240 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(targetdescriptor, data); inedge_iterator != inedge_end; ++inedge_iterator)
2242 std::string subserie(actualserie);
2248 const int actionid = inedgeproperties.
getactionID();
2249 const int perioddiff = startperiod - targetproperties.
get().
getperiod();
2251 if ( actionselected.find(actionid) != actionselected.end())
2255 subserie = actions.at(actionid).getname() +
"-" + subserie;
2264 for (
const Core::FMTSerie& subofserie : getallseries(subdescriptor, subserie, actions, actionselected, mask))
2267 const int perioddepth = subofserie.getLength() + perioddiff;
2268 theseries.insert(
Core::FMTSerie(subofserie.getSerie(), perioddepth));
2277 boost::tie(inedge_iterator, inedge_end) = boost::in_edges(targetdescriptor, data);
2278 if (inedge_iterator != inedge_end)
2280 targetdescriptor = boost::source(*inedge_iterator, data);
2286 const int actionid = inedgeproperties.
getactionID();
2287 if ( actionselected.find(actionid) != actionselected.end())
2289 actualserie = actions.at(actionid).getname() +
"-" + actualserie;
2292 inedgessize = boost::in_degree(targetdescriptor, data);
2301 _exhandler->printexceptions(
"",
"FMTgraph::getallseries", __LINE__, __FILE__);
2309 std::queue<std::pair<FMTvertex_descriptor,size_t>>verticies_n_depth;
2310 verticies_n_depth.push(std::pair<FMTvertex_descriptor, size_t>(targetdescriptor, 0));
2311 while (!verticies_n_depth.empty())
2313 const std::pair<FMTvertex_descriptor, size_t> descriptor_n_depth = verticies_n_depth.front();
2315 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(descriptor_n_depth.first, data); inedge_iterator != inedge_end; ++inedge_iterator)
2320 return descriptor_n_depth.second;
2323 verticies_n_depth.push(std::pair<FMTvertex_descriptor, size_t>(sourcevertex,descriptor_n_depth.second+1));
2326 verticies_n_depth.pop();
2331 _exhandler->raisefromcatch(
"",
"FMTgraph::timesincelastaction", __LINE__, __FILE__);
2333 return std::numeric_limits<size_t>::max();
2338 const std::vector<std::string>& yieldnames,
const size_t& depth,
bool periodonevalues=
false,
bool withGCBMid =
true)
const
2340 std::vector<FMTpredictor> predictors;
2344 const int targetperiod = targetproperties.
get().
getperiod();
2345 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(targetdescriptor, data); inedge_iterator != inedge_end; ++inedge_iterator)
2347 std::vector<const FMTbaseedgeproperties*>lastactions;
2348 std::vector<int>distances;
2351 const int sourceperiod = sourceproperties.
get().
getperiod();
2352 if (sourceperiod>0||periodonevalues)
2354 lastactions.push_back(&data[*inedge_iterator]);
2355 distances.push_back(targetperiod-sourceperiod);
2359 filluplastactions(targetperiod, sourcevertex, lastactions, distances, depth);
2360 while (lastactions.size()<= depth)
2362 lastactions.push_back(
nullptr);
2363 distances.push_back(-1);
2365 predictors.emplace_back(model.
actions, yieldnames,model.
yields, sourceproperties, targetproperties, lastactions, distances,withGCBMid);
2367 predictors.shrink_to_fit();
2370 _exhandler->raisefromcatch(
"",
"FMTgraph::getpredictors", __LINE__, __FILE__);
2377 return data[*developments.at(getfirstactiveperiod() + 1).first].get().getperiod();
2380 const std::vector<Core::FMTtheme>&originalbasethemes,
2381 const std::vector<int>& actionmapconnection)
2384 developments.clear();
2388 for (boost::tie(edge_iterator, edge_iterator_end) = boost::edges(data); edge_iterator != edge_iterator_end; ++edge_iterator)
2396 boost::unordered_map<Core::FMTmask,Core::FMTmask>presolvetopostsolve;
2398 for (boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
2402 boost::unordered_map<Core::FMTmask, Core::FMTmask>::const_iterator mskit = presolvetopostsolve.find(presolvemask);
2403 if (mskit != presolvetopostsolve.end())
2408 presolvetopostsolve[presolvemask] = postsolvedmask;
2412 generatedevelopments();
2416 _exhandler->raisefromcatch(
"",
"FMTgraph::postsolve", __LINE__, __FILE__);
2423 if (
static_cast<int>(size()) > lperiod && lperiod > 0)
2429 for (boost::tie(vertex_iterator, vertex_iterator_end) = getperiodverticies(lperiod); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
2432 std::map<int, int>variables = getoutvariables(vertex);
2433 variables.erase(-1);
2434 if (!variables.empty())
2437 for (
const auto variable_iterator : variables)
2447 newschedule.
addevent(dev, *(actual_solution + variable_iterator.second), actions.at(variable_iterator.first));
2465 newschedule.
clean();
2477 _exhandler->raisefromcatch(
"at period " + std::to_string(lperiod),
"FMTgraph::getschedule", __LINE__, __FILE__);
2494 std::set<Core::FMTSerie>theseries;
2500 const int minperiod = 1;
2501 const int maxperiod =
static_cast<int>(developments.size() - 2);
2503 for (
int period = minperiod; period <= maxperiod;++period)
2509 for (edge_pair = boost::out_edges(targetdescriptor, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
2513 if ( actionsets.find(actionid) != actionsets.end())
2515 const std::string startup = model.
actions.at(actionid).getname();
2516 std::set<Core::FMTSerie>subset;
2517 const std::set<Core::FMTSerie>periodseries = getallseries(targetdescriptor,startup,model.
actions, actionsets, mask);
2518 if (!periodseries.empty())
2520 std::set_union(periodseries.begin(), periodseries.end(),
2521 theseries.begin(), theseries.end(),
2522 std::inserter(subset, std::begin(subset)));
2523 theseries.swap(subset);
2534 _exhandler->raisefromcatch(
"",
"FMTgraph::getrorations", __LINE__, __FILE__);
2544 if (
static_cast<int>(size()) > lperiod && lperiod > 0)
2547 for (boost::tie(vertex_iterator, vertex_iterator_end) = getperiodverticies(lperiod); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
2550 std::map<int, int>variables = getoutvariables(vertex);
2553 std::map<int,double>variablesarea;
2554 for (
const auto variable_iterator : variables)
2556 const double vout = *(actual_solution + variable_iterator.second);
2563 if(variable_iterator.first>=0)
2565 variablesarea[variable_iterator.first]=vout;
2571 for (
const auto variable_iterator : variablesarea)
2573 newschedule.
addevent(dev, variable_iterator.second/outarea, actions.at(variable_iterator.first));
2577 newschedule.
clean();
2582 _exhandler->raisefromcatch(
"at period " + std::to_string(lperiod),
"FMTgraph::getproportionsschedule", __LINE__, __FILE__);
2587 operator std::string()
const
2589 std::ostringstream stream;
2594 _exhandler->raisefromcatch(
"",
"FMTgraph::std::string()", __LINE__, __FILE__);
2596 return stream.str();
2604 std::map<int, int> mapping;
2607 for (edge_pair = boost::out_edges(out_vertex, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
2615 _exhandler->raisefromcatch(
"",
"FMTgraph::getoutvariables", __LINE__, __FILE__);
2625 std::vector<Core::FMTdevelopmentpath>paths;
2627 for (
FMToutedge_pair edge_pair = boost::out_edges(out_vertex, data); edge_pair.first != edge_pair.second; ++edge_pair.first)
2638 _exhandler->raisefromcatch(
"",
"FMTgraph::getpaths", __LINE__, __FILE__);
2651 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(out_vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
2654 if (edgeprop.
getactionID() == actionid || !growth)
2661 _exhandler->raisefromcatch(
"",
"FMTgraph::inarea", __LINE__, __FILE__);
2671 for (boost::tie(outedge_iterator, outedge_end) = boost::out_edges(out_vertex, data); outedge_iterator != outedge_end; ++outedge_iterator)
2681 _exhandler->raisefromcatch(
"",
"FMTgraph::outarea", __LINE__, __FILE__);
2689 std::map<int, double>variables;
2691 if (!verticies.empty())
2695 const std::vector<const Core::FMTaction*> selected = output_node.
source.
targets(model.
actions);
2709 const std::map<int, int>vars = getoutvariables(vertex);
2710 updatevarsmap(variables, vars.at(-1), coef);
2714 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(vertex, data); inedge_iterator != inedge_end; ++inedge_iterator)
2734 const std::map<int, int>outvars = getoutvariables(vertex);
2737 const int actionID =
static_cast<int>(std::distance(&(*model.
actions.begin()), act));
2738 if (outvars.find(actionID) != outvars.end())
2740 const std::vector<Core::FMTdevelopmentpath>paths = getpaths(vertex, actionID);
2742 updatevarsmap(variables, outvars.at(actionID), action_coef);
2751 _exhandler->raisefromcatch(
"",
"FMTgraph::getvariables", __LINE__, __FILE__);
2757 std::vector<int>&deletedvariables,
2761 typename std::vector<FMTvertex_pair>::iterator periodit = this->getfirstblock();
2763 for (boost::tie(vertexit, vertexend) = *periodit; vertexit != vertexend; ++vertexit)
2767 bool gotinedges =
false;
2768 const bool nottransferrow = isnotransfer(vertex_location, 1);
2770 if (!nottransferrow)
2772 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(vertex_location, data); inedge_iterator != inedge_end; ++inedge_iterator)
2777 if (std::find(deletedvariables.begin(), deletedvariables.end(), varvalue) == deletedvariables.end())
2780 deletedvariables.push_back(varvalue);
2788 if (!nottransferrow)
2790 const std::map<int, int>outvars = this->getoutvariables(vertex_location);
2791 for (std::map<int, int>::const_iterator varit = outvars.begin(); varit != outvars.end(); varit++)
2793 if (std::find(deletedvariables.begin(), deletedvariables.end(), varit->second) == deletedvariables.end())
2796 deletedvariables.push_back(varit->second);
2801 boost::clear_out_edges(vertex_location, data);
2803 boost::clear_in_edges(vertex_location, data);
2807 bool assigned =
false;
2808 for (boost::tie(vertexit, vertexend) = *periodit; vertexit != vertexend; ++vertexit)
2813 if (constvalue >= 0)
2816 --stats.transfer_rows;
2817 deletedconstraints.push_back(constvalue);
2820 if (!keepbounded || out_degree(vertex_location, data) == 0)
2822 boost::remove_vertex(vertex_location, data);
2827 firstvertex = vertexit;
2828 lastvertex = vertexit;
2832 lastvertex = vertexit;
2838 const int firstperiod = this->getfirstactiveperiod();
2848 _exhandler->raisefromcatch(
"",
"FMTgraph::eraseperiod", __LINE__, __FILE__);
2855 data[vertex].setconstraintID(
id);
2859 std::vector<int>&row_starts,
2860 std::vector<int>& cols,
2861 std::vector<double>& cols_value)
const
2866 row_starts.push_back(
static_cast<int>(cols.size()));
2868 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(vertex_descriptor, data); inedge_iterator != inedge_end; ++inedge_iterator)
2875 std::vector<int>locals;
2877 for (boost::tie(outedge_iterator, outedge_end) = boost::out_edges(vertex_descriptor, data); outedge_iterator != outedge_end; ++outedge_iterator)
2881 if (std::find(locals.begin(), locals.end(), edgevar) == locals.end())
2883 cols.push_back(edgevar);
2884 locals.push_back(edgevar);
2885 cols_value.push_back(-1);
2892 "No in variables for development "+std::string(dev),
"FMTgraph::gettransferrow", __LINE__, __FILE__);
2897 _exhandler->raisefromcatch(
"",
"FMTgraph::gettransferrow", __LINE__, __FILE__);
2907 for (boost::tie(inedge_iterator, inedge_end) = boost::in_edges(vertex_descriptor, data); inedge_iterator != inedge_end; ++inedge_iterator)
2915 _exhandler->raisefromcatch(
"",
"FMTgraph::getinproportion", __LINE__, __FILE__);
2923 const std::vector<int>& removedvariables,
2924 const std::vector<int>& removedconstraints)
2927 if (!removedconstraints.empty())
2929 const int& maxconstraint = removedconstraints.back();
2930 const int& minconstraint = removedconstraints.front();
2932 for (boost::tie(vertex_iterator, vertex_iterator_end) = boost::vertices(data); vertex_iterator != vertex_iterator_end; ++vertex_iterator)
2936 if (actualconstraint >= 0)
2939 if (actualconstraint > minconstraint && actualconstraint < maxconstraint)
2941 std::vector<int>::const_iterator removeditconstraint = removedconstraints.begin();
2942 while (removeditconstraint != removedconstraints.end() && actualconstraint > *removeditconstraint)
2945 ++removeditconstraint;
2948 else if (actualconstraint > maxconstraint)
2950 toremove =
static_cast<int>(removedconstraints.size());
2957 if (!removedvariables.empty())
2959 const int& maxvariable = removedvariables.back();
2960 const int& minvariable = removedvariables.front();
2962 for (boost::tie(edge_iterator, edge_iterator_end) = boost::edges(data); edge_iterator != edge_iterator_end; ++edge_iterator)
2966 if (actualvariable >= 0)
2969 if (actualvariable > minvariable && actualvariable < maxvariable)
2971 std::vector<int>::const_iterator removeditvariable = removedvariables.begin();
2972 while (removeditvariable != removedvariables.end() && actualvariable > *removeditvariable)
2975 ++removeditvariable;
2978 else if (actualvariable > maxvariable)
2980 toremove =
static_cast<int>(removedvariables.size());
2990 _exhandler->raisefromcatch(
"",
"FMTgraph::updatematrixindex", __LINE__, __FILE__);
3001 namespace serialization
3003 template<>
struct guid_defined<
Graph::FMTgraph<Graph::FMTvertexproperties, Graph::FMTedgeproperties>> : boost::mpl::true_
3007 template<>
struct guid_defined<
Graph::FMTgraph<Graph::FMTbasevertexproperties, Graph::FMTbaseedgeproperties>> : boost::mpl::true_
3011 template<>
inline const char * guid<Graph::FMTgraph<Graph::FMTvertexproperties, Graph::FMTedgeproperties>>()
3013 return "Graph::FMTgraph<Graph::FMTvertexproperties,Graph::FMTedgeproperties>";
3015 template<>
inline const char * guid<Graph::FMTgraph<Graph::FMTbasevertexproperties, Graph::FMTbaseedgeproperties>>()
3017 return "Graph::FMTgraph<Graph::FMTbasevertexproperties,Graph::FMTbaseedgeproperties>";
#define FMT_COMMA
Definition: FMTgraph.hpp:73
#define FMT_DBL_TOLERANCE
Definition: FMTutility.hpp:11
#define FMTEXPORT
Definition: FMTutility.hpp:92
The class keep information of a serie of actions in a given order.
Definition: FMTSerie.hpp:22
Definition: FMTaction.hpp:42
bool dorespectlock() const
Definition: FMTaction.hpp:160
std::string getname() const
Definition: FMTaction.hpp:151
Definition: FMTaction.hpp:327
std::unordered_set< int > getallaggregatesset(const std::vector< FMTaction > &actions, bool aggregateonly=false) const
Definition: FMTactualdevelopment.hpp:25
Definition: FMTconstraint.hpp:54
Definition: FMTdevelopment.hpp:44
std::vector< FMTdevelopmentpath > operate(const FMTaction &action, const FMTtransition &Transition, const Core::FMTyields &ylds, const std::vector< FMTtheme > &themes) const
int getlock() const
Definition: FMTdevelopment.hpp:90
FMTdevelopment clearlock() const
std::vector< bool > isanyworthtestingoperability(const std::vector< const FMTaction * > &actions, const std::vector< FMTaction > &allactions) const noexcept
const Core::FMTmask & getmask() const
Definition: FMTdevelopment.hpp:106
void setperiod(const int &lperiod)
bool operable(const FMTaction &action, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const
bool anyoperable(const std::vector< const FMTaction * > &actions, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const
int getage() const
Definition: FMTdevelopment.hpp:82
int getperiod() const
Definition: FMTdevelopment.hpp:98
FMTfuturdevelopment grow() const
Definition: FMTdevelopmentpath.hpp:19
Definition: FMTfuturdevelopment.hpp:24
Definition: FMTlookup.hpp:18
Definition: FMTmask.hpp:96
std::string get(const std::vector< FMTtheme > &themes) const
bool issubsetof(const boost::dynamic_bitset<> &rhs) const
Definition: FMTmask.hpp:352
FMTmask postsolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &basethemes) const
Definition: FMTmaskfilter.hpp:27
Definition: FMTobject.hpp:50
FMTobject & operator=(const FMTobject &rhs)
Definition: FMToutput.hpp:39
std::vector< FMToutputnode > getnodes(std::vector< std::string > &equation, double multiplier=1, bool orderbyoutputid=false, int period=1) const
bool canbenodesonly() const
std::vector< std::string > getdecomposition(const std::vector< FMTtheme > &themes) const
int targetthemeid() const
Definition: FMToutput.hpp:270
FMTtheme targettheme(const std::vector< FMTtheme > &themes) const
void fillfromshuntingyard(const std::vector< std::string >baseeq, std::map< std::string, double > &results, const std::vector< Core::FMToutputnode > &nodes, std::map< std::string, std::vector< std::string > > &allequations) const
Definition: FMToutputnode.hpp:20
double constant
Definition: FMToutputnode.hpp:24
int settograph(std::vector< int > &targetedperiods, int period, int max_period)
FMToutputsource factor
Definition: FMToutputnode.hpp:23
FMToutputsource source
Definition: FMToutputnode.hpp:22
Definition: FMToutputsource.hpp:40
bool isaction() const
Definition: FMToutputsource.hpp:190
const std::string & getaction() const
Definition: FMToutputsource.hpp:102
std::vector< const FMTaction * > targets(const std::vector< FMTaction > &actions) const
bool isvariablelevel() const
Definition: FMToutputsource.hpp:127
double getcoef(const FMTdevelopment &development, const FMTyields &yields, const Graph::FMTgraphvertextoyield *graphinfo=nullptr, std::vector< FMTdevelopmentpath > const *paths=nullptr, FMTaction const *action=nullptr) const
bool isnextperiod() const
Definition: FMToutputsource.hpp:154
bool isnull(const FMTyields &ylds) const
bool use(const FMTdevelopment &development, const FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphinfo=nullptr) const
Definition: FMToutputsource.hpp:167
bool useinedges() const
Definition: FMToutputsource.hpp:150
int getthemetarget() const
Definition: FMToutputsource.hpp:84
Definition: FMTschedule.hpp:31
const std::map< FMTdevelopment, std::vector< double > > & at(const FMTaction &action) const
iterator find(const FMTaction &actionkey)
void addevent(const Core::FMTdevelopment &dev, const double &area, const Core::FMTaction &action)
Definition: FMTbounds.hpp:342
Definition: FMTtheme.hpp:47
const std::vector< std::string > & getbaseattributes() const
Definition: FMTtheme.hpp:289
Definition: FMTbaseedgeproperties.hpp:26
virtual double getproportion() const
Definition: FMTbaseedgeproperties.hpp:48
void setactionID(const int &newid)
virtual int getvariableID() const
Definition: FMTbaseedgeproperties.hpp:44
int getactionID() const
Definition: FMTbaseedgeproperties.hpp:52
Definition: FMTbasevertexproperties.hpp:23
void setdevlopementmask(const Core::FMTmask &newmask)
const Core::FMTdevelopment & get() const
Definition: FMTbasevertexproperties.hpp:65
double getbaseRHS() const
Definition: FMTedgeproperties.hpp:20
int getvariableID() const override
Definition: FMTedgeproperties.hpp:36
void setvariableID(const int &newvariableID)
double getproportion() const override
Definition: FMTedgeproperties.hpp:41
Definition: FMTgraph.hpp:78
void cleardevelopments()
Definition: FMTgraph.hpp:317
virtual ~FMTgraph()=default
FMTinedge_iterator getlastdisturbance(FMTinedge_iterator activeedge, int &periodtolastdisturbance) const
Definition: FMTgraph.hpp:1993
FMTvertex_descriptor adddevelopment(const Core::FMTfuturdevelopment &futurdevelopement, boost::unordered_set< Core::FMTlookup< FMTvertex_descriptor, Core::FMTdevelopment > > &alldevs, bool forcenewone=false)
Definition: FMTgraph.hpp:837
const Core::FMTdevelopment & getdevelopment(const FMTvertex_descriptor &descriptor) const
Definition: FMTgraph.hpp:833
Core::FMTschedule getoutvariablesproportions(const std::vector< Core::FMTaction > &actions, const double *actual_solution, const int &lperiod, bool withlock=false) const
Definition: FMTgraph.hpp:2540
std::map< std::string, std::map< int, double > > locatenodebytheme(const Models::FMTmodel &model, Core::FMToutputnode output_node, int period) const
Definition: FMTgraph.hpp:1221
std::vector< int > getinvariables(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1394
std::vector< FMTvertex_pair >::const_iterator getfirstconstblock() const
Definition: FMTgraph.hpp:165
boost::graph_traits< FMTadjacency_list >::vertex_iterator FMTvertex_iterator
Definition: FMTgraph.hpp:114
bool sameedgesas(const FMTgraph &rhs) const
Definition: FMTgraph.hpp:1958
std::queue< FMTvertex_descriptor > initialize(const std::vector< Core::FMTactualdevelopment > &actdevelopments)
Definition: FMTgraph.hpp:351
bool onlypertiodstart(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1072
void addaction(const int &actionID, FMTgraphstats &statsdiff, std::queue< FMTvertex_descriptor > &actives, const FMTvertex_descriptor &out_vertex, const std::vector< Core::FMTdevelopmentpath > &paths)
Definition: FMTgraph.hpp:942
FMTgraphstats stats
Definition: FMTgraph.hpp:123
std::queue< FMTvertex_descriptor > getactiveverticies() const
Definition: FMTgraph.hpp:1626
std::map< std::string, double > getvalues(const Models::FMTmodel &model, const std::vector< FMTvertex_descriptor > &verticies, const Core::FMToutputnode &node, const Core::FMTtheme &theme, const double *solution, Core::FMToutputlevel level) const
Definition: FMTgraph.hpp:1798
const FMTvertex_descriptor * getvertexfromvertexinfo(const Graph::FMTgraphvertextoyield *info) const
Definition: FMTgraph.hpp:1783
std::vector< FMToutputnodecache< FMTvertex_descriptor FMT_COMMA FMTvertex_iterator > > nodescache
Definition: FMTgraph.hpp:121
void updatematrixindex(const std::vector< int > &removedvariables, const std::vector< int > &removedconstraints)
Definition: FMTgraph.hpp:1983
std::vector< FMTvertex_descriptor > getactionsources(const FMTvertex_descriptor &out_vertex, const int &actionid) const
Definition: FMTgraph.hpp:1012
void setstats(const FMTgraphstats &newstats)
Definition: FMTgraph.hpp:1551
void rebasecache()
Definition: FMTgraph.hpp:1902
std::map< int, int > getoutvariables(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1452
boost::unordered_set< Core::FMTlookup< FMTvertex_descriptor, Core::FMTdevelopment > > getdevsset(const int &period) const
Definition: FMTgraph.hpp:329
FMTgraphstats buildschedule(const Models::FMTmodel &model, std::queue< FMTvertex_descriptor > actives, const Core::FMTschedule &schedule)
Definition: FMTgraph.hpp:1556
std::vector< Core::FMTdevelopmentpath > getpaths(const FMTvertex_descriptor &out_vertex, const int &actionID) const
Definition: FMTgraph.hpp:1140
FMTgraph(const FMTgraph &rhs)
Definition: FMTgraph.hpp:242
int getfirstactiveperiod() const
Definition: FMTgraph.hpp:1988
std::pair< FMToutedge_iterator, FMToutedge_iterator > FMToutedge_pair
Definition: FMTgraph.hpp:116
std::set< Core::FMTSerie > getallseries(FMTvertex_descriptor targetdescriptor, const std::string &seriestarter, const std::vector< Core::FMTaction > &actions, const std::unordered_set< int > &actionselected, const Core::FMTmask &mask) const
Definition: FMTgraph.hpp:2223
std::vector< FMTpredictor > getpredictors(const FMTvertex_descriptor &targetdescriptor, const Models::FMTmodel &model, const std::vector< std::string > &yieldnames, const size_t &depth, bool periodonevalues=false, bool withGCBMid=true) const
Definition: FMTgraph.hpp:2337
boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, tvertexproperties, tedgeproperties, boost::no_property, boost::listS > FMTadjacency_list
Definition: FMTgraph.hpp:107
bool periodstop(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1116
bool gettransferrow(const FMTvertex_descriptor &vertex_descriptor, std::vector< int > &row_starts, std::vector< int > &cols, std::vector< double > &cols_value) const
Definition: FMTgraph.hpp:1666
std::map< std::string, double > getsource(const Models::FMTmodel &model, const Core::FMToutputnode &node, int period, const Core::FMTtheme &theme, const double *solution, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
Definition: FMTgraph.hpp:1755
size_t nedges() const
Definition: FMTgraph.hpp:1692
std::vector< std::string > getactionserie(FMTvertex_descriptor targetdescriptor, const size_t &maxactions, const std::vector< Core::FMTaction > &actions) const
Definition: FMTgraph.hpp:2179
FMTgraphbuild getbuildtype() const
Definition: FMTgraph.hpp:321
std::vector< FMTvertex_descriptor > getnode(const Models::FMTmodel &model, Core::FMToutputnode &output_node, int period) const
Definition: FMTgraph.hpp:1258
void generatedevelopments()
Definition: FMTgraph.hpp:1917
FMTgraphstats eraseperiod(std::vector< int > &deletedconstraints, std::vector< int > &deletedvariables, bool keepbounded=false)
Definition: FMTgraph.hpp:1614
bool isvalidouputnode(const Models::FMTmodel &model, const Core::FMToutputnode &node, std::vector< const Core::FMTaction * > &action_IDS, int period) const
Definition: FMTgraph.hpp:1161
void filluplastactions(const int &targetperiod, const FMTvertex_descriptor &targetdescriptor, std::vector< const FMTbaseedgeproperties * > &lastactions, std::vector< int > &distances, const size_t &depth) const
Definition: FMTgraph.hpp:2024
void getinitialbounds(std::vector< double > &lower_bounds, std::vector< double > &upper_bounds) const
Definition: FMTgraph.hpp:1673
Core::FMTschedule getschedule(const std::vector< Core::FMTaction > &actions, const double *actual_solution, const int &lperiod, bool withlock=false) const
Definition: FMTgraph.hpp:2419
size_t getamountofpaths(const Core::FMTdevelopment &dev, const int &actionid, const Models::FMTmodel &model, const boost::unordered_set< Core::FMTlookup< FMTvertex_descriptor, Core::FMTdevelopment > > &actualperioddevs) const
Definition: FMTgraph.hpp:2062
void setbuildtype(const FMTgraphbuild &build)
Definition: FMTgraph.hpp:325
boost::graph_traits< FMTadjacency_list >::in_edge_iterator FMTinedge_iterator
Definition: FMTgraph.hpp:112
bool periodstart(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1052
bool containsdevelopment(const Core::FMTdevelopment &development, const boost::unordered_set< Core::FMTlookup< FMTvertex_descriptor, Core::FMTdevelopment > > &alldevs) const
Definition: FMTgraph.hpp:345
bool isdependant(const FMTvertex_descriptor &descriptor, const int &theactionid, bool &newedge) const
Definition: FMTgraph.hpp:188
std::map< int, double > getvariables(const Models::FMTmodel &model, const Core::FMToutputnode &output_node, const std::vector< FMTvertex_descriptor > &verticies) const
Definition: FMTgraph.hpp:1342
double getinproportion(const FMTvertex_descriptor &vertex_descriptor) const
Definition: FMTgraph.hpp:516
FMTvertex_descriptor adddevelopment(const Core::FMTfuturdevelopment &futurdevelopement)
Definition: FMTgraph.hpp:858
std::map< std::string, double > getoutput(const Models::FMTmodel &model, const Core::FMToutput &output, int period, const double *solution, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
Definition: FMTgraph.hpp:740
void getvariablenames(const std::vector< Core::FMTaction > &actions, std::vector< std::string > &colnames) const
Definition: FMTgraph.hpp:616
void addaction(const int &actionID, FMTgraphstats &statsdiff, std::queue< FMTvertex_descriptor > &actives, const FMTvertex_descriptor &out_vertex, const std::vector< Core::FMTdevelopmentpath > &paths, boost::unordered_set< Core::FMTlookup< FMTvertex_descriptor, Core::FMTdevelopment > > &devsets, bool inserie=false)
Definition: FMTgraph.hpp:892
void gettransferrownames(std::vector< std::string > &rownames) const
Definition: FMTgraph.hpp:692
std::vector< FMTvertex_descriptor > getnodebystaticmask(const Models::FMTmodel &model, const Core::FMToutputnode &node, int period) const
Definition: FMTgraph.hpp:1697
void postsolve(const Core::FMTmaskfilter &filter, const std::vector< Core::FMTtheme > &originalbasethemes, const std::vector< int > &actionmapconnection)
Definition: FMTgraph.hpp:2379
void clearcache()
Definition: FMTgraph.hpp:313
FMTgraphstats * getstatsptr()
Definition: FMTgraph.hpp:1547
int getfirstperiod() const
Definition: FMTgraph.hpp:2375
int getperiod() const
Definition: FMTgraph.hpp:1888
size_t timesincelastaction(const FMTvertex_descriptor &targetdescriptor) const
Definition: FMTgraph.hpp:2306
FMTgraphstats build(const Models::FMTmodel &model, std::queue< FMTvertex_descriptor > actives, int compressageoperability=1)
Definition: FMTgraph.hpp:419
size_t size() const
Definition: FMTgraph.hpp:1658
std::vector< Core::FMTactualdevelopment > getperiodstopdev(const int location, const double *actual_solution) const
Definition: FMTgraph.hpp:718
std::map< int, int > getinidsvariables(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1432
std::vector< int > getoutactions(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1473
FMTgraph()
Definition: FMTgraph.hpp:219
std::vector< FMTvertex_pair >::iterator getfirstblock()
Definition: FMTgraph.hpp:141
const FMTvertex_pair & getperiodverticies(int period) const
Definition: FMTgraph.hpp:1644
FMTgraphstats getstats() const
Definition: FMTgraph.hpp:1543
FMTvertex_descriptor getdevelopment(const Core::FMTdevelopment &developement, const boost::unordered_set< Core::FMTlookup< FMTvertex_descriptor, Core::FMTdevelopment > > &alldevs) const
Definition: FMTgraph.hpp:827
bool constraintlenght(const Core::FMTconstraint &constraint, int &start, int &stop) const
Definition: FMTgraph.hpp:1520
boost::graph_traits< FMTadjacency_list >::vertex_descriptor FMTvertex_descriptor
Definition: FMTgraph.hpp:110
std::vector< double > getinproportions(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:1413
FMTgraph(const FMTgraphbuild lbuildtype)
Definition: FMTgraph.hpp:231
bool anyoperables(const FMTvertex_descriptor &descriptor, const std::vector< int > &action_ids) const
Definition: FMTgraph.hpp:1373
std::vector< Core::FMTaction >::const_iterator getactionoffirstserie(const FMTvertex_descriptor &targetdescriptor, std::vector< Core::FMTaction >::const_iterator theaction, const size_t &seriemaxsize, const std::vector< Core::FMTaction > &actions) const
Definition: FMTgraph.hpp:2127
FMTvertex_descriptor getgrowthsource(const FMTvertex_descriptor &out_vertex) const
Definition: FMTgraph.hpp:993
void setconstraintID(const FMTvertex_descriptor &vertex, const int &id)
Definition: FMTgraph.hpp:1662
boost::graph_traits< FMTadjacency_list >::edge_descriptor FMTedge_descriptor
Definition: FMTgraph.hpp:111
std::set< Core::FMTSerie > getrorations(const Models::FMTmodel &model, const Core::FMTmask &mask, const std::string &aggregate) const
Definition: FMTgraph.hpp:2492
std::vector< FMToutputnodecache< FMTvertex_descriptorFMT_COMMAFMTvertex_iterator > >::reverse_iterator reversecachenodeit
Definition: FMTgraph.hpp:122
bool keepforserie(const FMTvertex_descriptor &targetdescriptor, std::vector< Core::FMTaction >::const_iterator theaction, const size_t &seriemaxsize, const std::vector< Core::FMTaction > &actions, bool &onserie) const
Definition: FMTgraph.hpp:2149
boost::graph_traits< FMTadjacency_list >::edge_iterator FMTedge_iterator
Definition: FMTgraph.hpp:115
void swap(FMTgraph &rhs)
Definition: FMTgraph.hpp:253
FMTadjacency_list data
Definition: FMTgraph.hpp:108
std::vector< FMTvertex_pair > developments
Definition: FMTgraph.hpp:120
size_t hash(size_t seed=0) const
Definition: FMTgraph.hpp:874
bool empty() const
Definition: FMTgraph.hpp:1621
bool isnotransfer(const FMTvertex_descriptor &descriptor, size_t outcount=0) const
Definition: FMTgraph.hpp:491
double outarea(const FMTvertex_descriptor &out_vertex, const int &actionID, const double *&solution) const
Definition: FMTgraph.hpp:968
std::pair< FMTvertex_iterator, FMTvertex_iterator > FMTvertex_pair
Definition: FMTgraph.hpp:117
bool isanyoperables(const FMTvertex_descriptor &descriptor, const std::vector< bool > &actionsop) const noexcept
Definition: FMTgraph.hpp:1346
std::vector< const Core::FMTaction * > selectedactions(const Models::FMTmodel &model, const std::vector< int > &action_IDS) const
Definition: FMTgraph.hpp:1500
std::vector< const Core::FMTdevelopment * > nochoice(const Core::FMTmask &basemask, const int &death_id) const
Definition: FMTgraph.hpp:563
double inarea(const FMTvertex_descriptor &out_vertex, const double *&solution, int actionid=-1, bool growth=false) const
Definition: FMTgraph.hpp:1032
boost::graph_traits< FMTadjacency_list >::out_edge_iterator FMToutedge_iterator
Definition: FMTgraph.hpp:113
bool isvalidgraphnode(const Models::FMTmodel &model, const FMTvertex_descriptor &vertex_descriptor, const Core::FMToutputnode &node, const std::vector< const Core::FMTaction * > &selected) const
Definition: FMTgraph.hpp:1181
int getmaximalock(const int &period)
Definition: FMTgraph.hpp:1096
FMTgraphbuild buildtype
Definition: FMTgraph.hpp:119
Graph::FMTgraphvertextoyield getvertextoyieldinfo(const Models::FMTmodel &model, const FMTvertex_descriptor &descriptor) const
Definition: FMTgraph.hpp:1772
FMTgraphstats naturalgrowth(std::queue< FMTvertex_descriptor > actives, FMTgraphstats statsdiff, bool typeIImatrix=false, bool splitgrowth=false)
Definition: FMTgraph.hpp:521
std::map< int, double > locatenode(const Models::FMTmodel &model, Core::FMToutputnode output_node, int period) const
Definition: FMTgraph.hpp:1206
Definition: FMTgraphstats.hpp:28
int cols
Number of columns in the matrix of FMTlpsolver.
Definition: FMTgraphstats.hpp:48
Definition: FMTgraphvertextoyield.hpp:27
const void * getvertexptr() const
Definition: FMTgraphvertextoyield.hpp:47
Definition: FMToutputnodecache.hpp:27
Definition: FMTvertexproperties.hpp:28
void setconstraintID(const int &ID)
int getconstraintID() const override
Definition: FMTvertexproperties.hpp:49
Definition: FMTmodel.hpp:60
Core::FMTyields yields
Yields data comming from the yield file.
Definition: FMTmodel.hpp:595
bool isstaticnode(const Core::FMToutputnode &node, double ratioofset=0.1) const
Core::FMTmask getstaticmask(const Core::FMToutputnode &node, bool ignoreoutputvariables=false) const
std::vector< Core::FMTtheme > themes
Model themes of the landscape section file.
Definition: FMTmodel.hpp:586
std::vector< Core::FMTtransition > transitions
Model transitions from the transition file and also the _death transition.
Definition: FMTmodel.hpp:592
size_t getseriesmaxsize() const
int getparameter(const FMTintmodelparameters &key) const
bool useactionserie() const
std::vector< Core::FMTaction > actions
Model actions from the action file and also the _death action.
Definition: FMTmodel.hpp:589
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMToutputlevel
Definition: FMTutility.hpp:17
@ developpement
Definition: FMTutility.hpp:20
@ totalonly
Definition: FMTutility.hpp:19
@ standard
Definition: FMTutility.hpp:18
@ actual
Definition: FMTutility.hpp:76
@ val
Definition: FMTutility.hpp:77
@ FMTunsupported_output
Definition: FMTexception.hpp:77
@ FMTfunctionfailed
Definition: FMTexception.hpp:95
@ FMTinvalid_action
Definition: FMTexception.hpp:51
@ FMTsourcetotarget_transition
Definition: FMTexception.hpp:121
@ FMTrangeerror
Definition: FMTexception.hpp:100
Namespace for using/building unidirectional graphs in FMT.
Definition: FMTareaparser.hpp:31
FMTgraphbuild
Definition: FMTgraph.hpp:67
@ MATRIX_TYPE
Definition: FMTmodelparameters.hpp:30
Definition: FMTaction.hpp:364