00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include <string>
00033 using namespace std;
00034 #include <boost/python.hpp>
00035 #include <boost/python/class.hpp>
00036 #include <boost/python/module.hpp>
00037 #include <boost/python/def.hpp>
00038
00039 namespace Modelib {
00040
00041
00042
00043
00044 void export_NumVar()
00045 {
00046 using namespace boost::python;
00047 class_<NumVar>("NumVar")
00048 .def(init<>())
00049 .def(init<Model&,optional<float,float,MuteVar::VarType,const string&> >())
00050
00051
00052 .def("GetVarId", &NumVar::GetVarId)
00053
00054 .def("GetValue", &NumVar::GetValue)
00055 .def("GetName", &NumVar::GetName)
00056 .def("SetName", &NumVar::SetName)
00057 .def("GetLowerBound", &NumVar::GetLowerBound)
00058 .def("SetLowerBound", &NumVar::SetLowerBound)
00059 .def("GetUpperBound", &NumVar::GetUpperBound)
00060 .def("SetUpperBound", &NumVar::SetUpperBound)
00061 .def("IsLowerBoundStrict", &NumVar::IsLowerBoundStrict)
00062 .def("SetLowerBoundStrict", &NumVar::SetLowerBoundStrict)
00063 .def("IsUpperBoundStrict", &NumVar::IsUpperBoundStrict)
00064 .def("SetUpperBoundStrict", &NumVar::SetUpperBoundStrict)
00065 .def("GetType", &NumVar::GetType)
00066 .def("SetType", &NumVar::SetType)
00067 ;
00068
00069 class_<IntVar, bases<NumVar> >("IntVar", init<Model&,optional<float,float,const string&> >())
00070 .def(init<Model&, optional<float,float,const string&> >())
00071 ;
00072
00073 class_<FloatVar, bases<NumVar> >("FloatVar", init<Model&,optional<float,float,const string&> >())
00074 .def(init<Model&, optional<float, float, const string&> >())
00075 ;
00076 class_<BoolVar, bases<NumVar> >("BoolVar", init<Model&>())
00077 .def(init<Model&, optional<const string&> >())
00078 ;
00079
00080 }
00081
00082
00083 }