8#ifndef PYEXPORTParallel_H_INCLUDED
9#define PYEXPORTParallel_H_INCLUDED
20#include "boost/python.hpp"
24BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(push_back_overloads, push_back, 1, 3)
28 namespace bp = boost::python;
29 bp::object ParallelModule(bp::handle<>(bp::borrowed(PyImport_AddModule(
"FMT.Parallel"))));
30 bp::scope().attr(
"Parallel") = ParallelModule;
31 bp::scope ParallelModule_scope = ParallelModule;
32 bp::scope().attr(
"__doc__") =
".. module:: Parallel\n"
34 " :platform: Unix, Windows\n"
35 " :synopsis: Module used for FMT parallel tasks handling.\n"
39 bp::class_<Parallel::FMTTask, bp::bases<Core::FMTObject>>(
"FMTtask",
"@DocString(FMTTask)")
40 .def(bp::init<Parallel::FMTTask>());
42 definePyList<Parallel::FMTTask>();
44 bp::class_<Parallel::FMTReplanningTask, bp::bases<Parallel::FMTTask>>(
"FMTreplanningtask",
"@DocString(FMTReplanningTask)")
45 .def(bp::init<Parallel::FMTReplanningTask>())
47 const std::string&,
const std::string&,
const std::vector<std::string>&,
49 bp::args(
"Strategic model",
"stochastic model",
"tactic model",
"selected outputs",
"Output folder",
"GDAL driver name",
"GDAL driver creation options",
"Number of replicates",
"Number of replanning periods",
"minimaldrift",
"output level",
"Write schedule"),
"@DocString(FMTReplanningTask::FMTReplanningTask(const Models::FMTModel&,const Models::FMTModel&,const Models::FMTModel&))"));
51 definePyList<Parallel::FMTReplanningTask>();
54 bp::class_<Parallel::FMTPlanningTask, bp::bases<Parallel::FMTTask>>(
"FMTplanningtask",
"@DocString(FMTPlanningTask)")
55 .def(bp::init<Parallel::FMTPlanningTask>())
56 .def(bp::init<
const int&,
const int&,
const std::string&, std::string,
58 bp::args(
"Min output period",
"Max output period",
"Output folder",
"GDAL driver name",
"GDAL driver creation options",
"output level",
"primary file localisation"),
"@DocString(FMTPlanningTask::FMTPlanningTask(...))"))
61 definePyList<Parallel::FMTPlanningTask>();
63 bp::class_<Parallel::FMTOpAreaSchedulerTask, bp::bases<Parallel::FMTTask>>(
"FMTopareaschedulertask",
"@DocString(FMTOpAreaSchedulerTask")
64 .def(bp::init<Parallel::FMTOpAreaSchedulerTask>())
65 .def(bp::init<
const Models::FMTLpModel&,
const std::vector<Heuristics::FMTOperatingAreaScheme>&,
67 const std::string&,
const unsigned int&,
69 bp::args(
"model",
"operating areas",
"node",
"output location",
"output yield name",
"maxiterations",
"maxtime",
"returntime_output"),
"@DocString(FMTOpAreaSchedulerTask::FMTOpAreaSchedulerTask(...))"));
71 definePyList<Parallel::FMTOpAreaSchedulerTask>();
74 bp::class_<Parallel::FMTTaskHandler, bp::bases<Core::FMTObject>>(
"FMTtaskhandler",
"@DocString(FMTTaskHandler)")
75 .def(bp::init<Parallel::FMTTaskHandler>())
76 .def(bp::init<const Parallel::FMTTask&, unsigned int>(bp::args(
"Task to provide to the handler",
"Number of threads"),
"@DocString(FMTTaskHandler::FMTTaskHandler(const Parallel::FMTTask&,unsigned int))"))
80 definePyList<Parallel::FMTTaskHandler>();
Node of an output representing a set of developments in the graph, holding a source,...
Definition: FMTOutputNode.h:25
Class letting the user formulate a constraint in the optimize section or collect data across the grap...
Definition: FMTOutput.h:37
Type III LP forest planning model, with the graph divided per period.
Definition: FMTLpModel.h:54
Base class for the different models in FMT.
Definition: FMTModel.h:62
void push_back(const Models::FMTModel &model, std::vector< Core::FMTSchedule >schedules=std::vector< Core::FMTSchedule >(), std::vector< Core::FMTOutput >louputs=std::vector< Core::FMTOutput >())
Push a new FMTModel in the task queue with an optional schedule.
void conccurentRun()
Use the split task virtual function to generate all the tasks and run them at the same time.
void onDemandRun()
Use the spawn task virtual function to generate tasks from the master task and add them to a list,...
FMToutputlevel
Enumerator describing the level of detail of an output (standard, total only, development).
Definition: FMTutility.h:22
Definition: PYdefinitions.h:14
void exportParallel()
Definition: PYexportParallel.h:26