FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
PYexportParallel.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef PYEXPORTParallel_H_INCLUDED
9#define PYEXPORTParallel_H_INCLUDED
10
11#include "FMTtask.hpp"
12#include "FMTtaskhandler.hpp"
13#include "FMTreplanningtask.hpp"
14#include "FMTplanningtask.hpp"
16#include "FMTmodel.hpp"
17#include "FMToutput.hpp"
18#include "FMTutility.hpp"
19#include <string>
20#include "boost/python.hpp"
21
22namespace Python
23{
24BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(push_back_overloads, push_back, 1, 3)
25
27 {
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"
33 "\n"
34 " :platform: Unix, Windows\n"
35 " :synopsis: Module used for FMT parallel tasks handling.\n"
36 "\n";
37
38
39 bp::class_<Parallel::FMTtask, bp::bases<Core::FMTobject>>("FMTtask", "@DocString(FMTtask)")
40 .def(bp::init<Parallel::FMTtask>());
41
42 define_pylist<Parallel::FMTtask>();
43
44 bp::class_<Parallel::FMTreplanningtask, bp::bases<Parallel::FMTtask>>("FMTreplanningtask", "@DocString(FMTreplanningtask)")
45 .def(bp::init<Parallel::FMTreplanningtask>())
46 .def(bp::init<const Models::FMTmodel&, const Models::FMTmodel&, const Models::FMTmodel&,const std::vector<Core::FMToutput>&,
47 const std::string&, const std::string&,const std::vector<std::string>&,
48 const int&,const int&,double,Core::FMToutputlevel>(
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"), "@DocString(FMTreplanningtask::FMTreplanningtask(const Models::FMTmodel&,const Models::FMTmodel&,const Models::FMTmodel&))"));
50
51 define_pylist<Parallel::FMTreplanningtask>();
52
53
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,
57 std::vector<std::string>, Core::FMToutputlevel, 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(...))"))
59 .def("push_back", &Parallel::FMTplanningtask::push_back, push_back_overloads(bp::args("model", "schedules", "outputs"), "@DocString(FMTplanningtask::push_back)"));
60
61 define_pylist<Parallel::FMTplanningtask>();
62
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>&,
66 const Core::FMToutputnode&,const std::string&,
67 const std::string&,const unsigned int&,
68 const double&,Core::FMToutput>(
69 bp::args("model", "operating areas", "node", "output location", "output yield name", "maxiterations","maxtime","returntime_output"), "@DocString(FMTopareaschedulertask::FMTopareaschedulertask(...))"));
70
71 define_pylist<Parallel::FMTopareaschedulertask>();
72
73
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))"))
77 .def("conccurentrun", &Parallel::FMTtaskhandler::conccurentrun,"@DocString(FMTtaskhandler::conccurentrun)")
78 .def("ondemandrun", &Parallel::FMTtaskhandler::ondemandrun, "@DocString(FMTtaskhandler::ondemandrun)");
79
80 define_pylist<Parallel::FMTtaskhandler>();
81
82 }
83}
84#endif // PYEXPORTParallel_H_INCLUDED
Definition: FMToutput.hpp:39
Definition: FMToutputnode.hpp:20
Definition: FMTlpmodel.hpp:57
Definition: FMTmodel.hpp:60
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 >())
FMToutputlevel
Definition: FMTutility.hpp:17
Definition: PYdefinitions.hpp:14
void exportParallel()
Definition: PYexportParallel.hpp:26