46 map<tString,SP::GPM_Variable> mEnvironments[4];
47 SV::GPM_CompositorFunction mFunctions;
49 tFlag mExpressionType;
52 int mIterationsNumber;
54 vector<tString> mResultGraphFiles;
57 tReal mMinPoint[3],mMaxPoint[3];
60 map<tString,tReal*> mBoundsValue;
68 SP::GPM_ModelGraph mInitGraph;
71 SV::GPM_ModelFunction mRules;
74 SP::GPM_ModelClassFactory mClassFactory;
101 inline static SP::GPMG_Project
New() {
102 SP::GPMG_Project p(
new GPMG_Project,GPMG_Project::Delete());
128 return *mClassFactory.get();
152 const double *value) {
154 var->setValue(card,value,type);
165 const double &value) {
167 var->setValue(value);
180 var->setValue(value);
194 const double *value) {
196 var->setValue(n,value);
207 SP::GPM_Variable var) ;
226 return mExpressionType;
233 return mIterationsNumber;
272 return mInitGraph.get();
277 return mInitGraph.get();
284 tBoolean succeeds=mInitGraph->loadFromFile(fn,io);
285 if (mInitGraph!=
null) mInitGraph->buildEnvironments(mEnvironments[NODE_ENVIRONMENT],
286 mEnvironments[PORT_ENVIRONMENT],
287 mEnvironments[EDGE_ENVIRONMENT]);
294 return mInitGraph->saveToFile(fn);
309 if (mInitGraph.get()!=
null) mInitGraph->updateGraphElementsEnvironment(mEnvironments[NODE_ENVIRONMENT],
310 mEnvironments[PORT_ENVIRONMENT],
311 mEnvironments[EDGE_ENVIRONMENT]);
313 int nRules=mRules.getSize();
314 for (
int i=0;i<nRules;i++) {
321 mEnvironments[PORT_ENVIRONMENT],
322 mEnvironments[EDGE_ENVIRONMENT]);
325 mEnvironments[PORT_ENVIRONMENT],
326 mEnvironments[EDGE_ENVIRONMENT]);
362 return mResultGraphFiles;
397 return mFunctions.getSize();
403 if ((i>=0) && (i<mFunctions.getSize()))
return mFunctions.get(i);
409 if ((i>=0) && (i<mFunctions.getSize()))
return mFunctions.get(i);
426 return (mClassFactory->newFunction().get()!=
null);
void addToEnvironment(const tFlag &index, const tString &name, const int &n, const double *value)
add an array of double to environment
Definition: GPMG_Project.h:191
void generateQuadInitGraph(const int &nTriangles, const tBoolean &withMiddle, const int &n, const int &m, const tReal &w, const tReal &h, const tReal &xmin, const tReal &ymin)
generate graph as grid
Definition: GPMG_Project.cpp:560
tBoolean saveInitGraph(const tString &fn) const
load the iit graph of themodel
Definition: GPMG_Project.h:293
void setResultGraphFiles(const vector< tString > &files)
get the result graph files :
Definition: GPMG_Project.cpp:755
static const tFlag INIT_GRAPH
Definition: GPMG_Project.h:36
const GPM_ModelClassFactory & getClassFactory() const
set the class factory
Definition: GPMG_Project.h:127
tBoolean areCompositorFunctionsAvailabled()
Definition: GPMG_Project.h:425
const GPM_CompositorFunction * getGlobalFunction(const int &i) const
get the function at index i
Definition: GPMG_Project.h:402
const GPM_PortGraph & getTransformerGraph() const
get the transformer graph for reading
Definition: GPM_Function.h:95
static const tFlag EDGE_ENVIRONMENT
Definition: GPMG_Project.h:28
void updateGraphsEnvironments()
update the environments of initial graph & graphs of rules
Definition: GPMG_Project.h:308
void clearInitGraph()
clear the init graph
Definition: GPMG_Project.cpp:557
This class describes a model graph.
Definition: GPM_ModelGraph.h:21
void addToEnvironment(const tFlag &index, const tString &name, const tFlag type, const int &card, const double *value)
add variable to environment
Definition: GPMG_Project.h:148
DEFINE_SPTR(GPMG_Project)
const SV::GPM_ModelFunction & getRules() const
get the rules for reading
Definition: GPMG_Project.h:336
static const tFlag UNKNOWN_GRAPH
Definition: GPMG_Project.h:38
static SP::GPM_Variable New()
Definition: GPM_Variable.h:59
#define tBoolean
Definition: types.h:35
static const tFlag RESULT_GRAPH
Definition: GPMG_Project.h:37
static SP::GPMG_Project New()
create a new instance of class
Definition: GPMG_Project.h:101
const map< tString, SP::GPM_Variable > & getGlobalVariables() const
get the default port variables
Definition: GPMG_Project.h:263
SV::GPM_CompositorFunction & getGlobalFunctions()
get the function at index
Definition: GPMG_Project.cpp:574
static const tFlag PATTERN_GRAPH
Definition: GPMG_Project.h:33
#define null
Definition: types.h:13
void setGlobalFunctions(const SV::GPM_CompositorFunction &fcts)
set the global functions
Definition: GPM_ModelFunction.h:141
void getVertexVariableNames(vector< tString > &vars) const
get the vertex variable names
Definition: GPMG_Project.cpp:215
const tReal * getMinPoint() const
get the min point of the graphs
Definition: GPMG_Project.h:243
This class describes a compositor function used in rules.
Definition: GPM_CompositorFunction.h:18
static const tFlag N_ENVIRONMENTS
Definition: GPMG_Project.h:31
const GPM_PortGraph & getPatternGraph() const
get the pattern graph for reading
Definition: GPM_Function.h:76
virtual ~GPMG_Project(void)
destroy an object.
Definition: GPMG_Project.cpp:46
static const tFlag PORT_ENVIRONMENT
Definition: GPMG_Project.h:29
void setClassFactory(SP::GPM_ModelClassFactory cf)
set the class factory
Definition: GPMG_Project.h:122
int getGlobalFunctionsNumber() const
get the function number
Definition: GPMG_Project.h:396
const vector< tString > & getResultGraphFiles() const
get the result graph files
Definition: GPMG_Project.h:361
tBoolean loadInitGraph(const tString &fn, CORE_Out &io)
load the iint graph of themodel
Definition: GPMG_Project.h:282
This class describes a node.
Definition: GPM_Variable.h:16
int getIterationsNumber() const
get the iterations number
Definition: GPMG_Project.h:232
This class is the class to save GPM classes.
Definition: GPM_ModelClassFactory.h:16
GPM_ModelGraph * getInitGraph()
get the init graph of the project
Definition: GPMG_Project.h:271
const map< tString, tReal * > & getBoundsValue() const
get the bounds
Definition: GPMG_Project.h:253
void clearRule(const int &index)
clear the rule at index
Definition: GPMG_Project.cpp:569
static const tFlag EXPRTK
Definition: GPMG_Project.h:41
tBoolean canBeRun() const
return true if the project can be run
Definition: GPMG_Project.cpp:396
SV::GPM_ModelFunction & getRules()
get the rules for writing
Definition: GPMG_Project.h:341
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_Project.cpp:50
This class describes a project.
Definition: GPMG_Project.h:22
static const tFlag NODE_ENVIRONMENT
Definition: GPMG_Project.h:27
#define tString
Definition: types.h:36
This class describes a graph which is a list of vertices, ports & edges.
Definition: GPM_PortGraph.h:22
const tReal * getMaxPoint() const
get the max point of the graphs
Definition: GPMG_Project.h:248
tBoolean saveData(const tString &projectFile)
save the data of the model from project file name
Definition: GPMG_Project.cpp:239
GPMG_Project(void)
create an object
Definition: GPMG_Project.cpp:28
this class describes a window to show movie of graphs
Definition: GPMG_MovieGraphWindow.h:17
void setGlobalFunctions(SV::GPM_CompositorFunction fs)
get the function at index i by copping functions of fs
Definition: GPMG_Project.cpp:742
const GPM_ModelGraph * getInitGraph() const
get the init graph of the project
Definition: GPMG_Project.h:276
this class describes the output by default write on standart output
Definition: CORE_Out.h:21
void setIterationsNumber(const int &n)
set the iterations number
Definition: GPMG_Project.h:212
void setGlobalVariables(const map< tString, SP::GPM_Variable > &variables)
set the global variable
Definition: GPM_ModelFunction.cpp:71
void addToEnvironment(const tFlag &index, const tString &name, const double &value)
add a double variable to environment
Definition: GPMG_Project.h:163
const map< tString, SP::GPM_Variable > & getEnvironment(const tFlag &index) const
get the default port variables
Definition: GPMG_Project.cpp:232
This class describes a pattern function.
Definition: GPM_ModelFunction.h:23
void updateGraphElementsEnvironment(const map< tString, SP::GPM_Variable > &nodeEnvironment, const map< tString, SP::GPM_Variable > &portEnvironment, const map< tString, SP::GPM_Variable > &edgeEnvironment)
update the environment of all graph elements (reverse method of build environments) ...
Definition: GPM_PortGraph.cpp:925
tBoolean loadData(const tString &projectFile)
load the data of the model from project file name
Definition: GPMG_Project.cpp:307
GPM_CompositorFunction * getGlobalFunction(const int &i)
get the function at index i
Definition: GPMG_Project.h:408
static const tFlag PT_CONNECTION
Definition: GPMG_Project.h:35
void clearEnvironment(const tFlag &index)
set the expression type
Definition: GPMG_Project.cpp:200
tFlag getExpressionType()
set the expression type
Definition: GPMG_Project.h:225
int run(const tString &projectFile, const int &iter0, const int &iterationsNumber, CORE_Out &io, GPMG_MovieGraphWindow *visualizer, tString &errorMessage, tBoolean &succeeds)
run the project
Definition: GPMG_Project.cpp:411
static const tFlag EXPR
Definition: GPMG_Project.h:40
int getIterationsDone() const
get the iterations done
Definition: GPMG_Project.h:237
static SP::GPM_ModelGraph New()
create a test class
Definition: GPM_ModelGraph.h:56
#define tReal
Definition: types.h:18
static const tFlag GLOBAL_ENVIRONMENT
Definition: GPMG_Project.h:30
static const tFlag TRANSFORMER_GRAPH
Definition: GPMG_Project.h:34
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_Project.cpp:107
void addToEnvironment(const tFlag &index, const tString &name, const tString &value)
add a string variable to environment
Definition: GPMG_Project.h:176
#define tFlag
Definition: types.h:14