Loading...
Searching...
No Matches
gamsmodelinstance.h
1
26#ifndef GAMSMODELINSTANCE_H
27#define GAMSMODELINSTANCE_H
28
29#include <string>
30#include <memory>
31#include <vector>
32#include "gamsenum.h"
33#include "gamsmodifier.h"
34#include "gamsmodelinstanceopt.h"
35
36namespace gams {
37
38class GAMSCheckpoint;
39class GAMSDatabase;
40class GAMSOptions;
41class GAMSModelInstanceImpl;
42
125class LIBSPEC GAMSModelInstance
126{
127public:
130
135
139 bool operator!=(const GAMSModelInstance& other) const;
140
144 bool operator==(const GAMSModelInstance& other) const;
145
148 bool isValid() const;
149
152
157 void instantiate(const std::string& modelDefinition, const gams::GAMSOptions& options
158 , const std::vector<gams::GAMSModifier>& modifiers = { });
159
166 void instantiate(const std::string& modelDefinition, const gams::GAMSOptions& options
167 , const GAMSModifier &modifier1 = GAMSModifier(), const GAMSModifier &modifier2 = GAMSModifier()
168 , const GAMSModifier &modifier3 = GAMSModifier());
169
173 void instantiate(const std::string& modelDefinition, const std::vector<gams::GAMSModifier>& modifiers = { });
174
180 void instantiate(const std::string& modelDefinition, const GAMSModifier &modifier1
181 , const GAMSModifier &modifier2 = GAMSModifier(), const GAMSModifier &modifier3 = GAMSModifier());
182
187 void solve(GAMSEnum::SymbolUpdateType updateType, std::ostream& output, GAMSModelInstanceOpt miOpt);
188
192
195 void solve(std::ostream& output);
196
199 void solve(GAMSEnum::SymbolUpdateType updateType = GAMSEnum::SymbolUpdateType::BaseCase);
200
203
205 std::string modelStatusAsString();
206
209
211 std::string solveStatusAsString();
212
216 GAMSModelInstance copyModelInstance(std::string modelInstanceName = "");
217
219 void interrupt();
220
224
227 std::string name();
228
231 LogId logID();
232
233private:
234 friend class GAMSCheckpointImpl;
235 GAMSModelInstance(const std::shared_ptr<GAMSModelInstanceImpl>& impl);
236 GAMSModelInstance(GAMSCheckpoint& checkpoint, const std::string& modelInstanceName = "");
237
238private:
239 std::shared_ptr<GAMSModelInstanceImpl> mImpl;
240};
241
242} // namespace gams
243
244#endif // GAMSMODELINSTANCE_H
SymbolUpdateType
Symbol update type.
Definition: gamsenum.h:208
ModelStat
Model Solution Status.
Definition: gamsenum.h:119
SolveStat
Solver termination condition.
Definition: gamsenum.h:101
The GAMSModelInstanceOpt can be used to customize the GAMSModelInstance.solve() routine.
std::string solveStatusAsString()
Get solve state as string.
void solve(GAMSEnum::SymbolUpdateType updateType, std::ostream &output, GAMSModelInstanceOpt miOpt)
void solve(GAMSModelInstanceOpt miOpt)
void interrupt()
Send interrupt signal to running GAMSModelInstance.
bool operator!=(const GAMSModelInstance &other) const
void instantiate(const std::string &modelDefinition, const gams::GAMSOptions &options, const std::vector< gams::GAMSModifier > &modifiers={ })
GAMSEnum::SolveStat solveStatus()
Get solve state.
void solve(GAMSEnum::SymbolUpdateType updateType=GAMSEnum::SymbolUpdateType::BaseCase)
std::string modelStatusAsString()
Get model state as string.
void instantiate(const std::string &modelDefinition, const GAMSModifier &modifier1, const GAMSModifier &modifier2=GAMSModifier(), const GAMSModifier &modifier3=GAMSModifier())
void instantiate(const std::string &modelDefinition, const gams::GAMSOptions &options, const GAMSModifier &modifier1=GAMSModifier(), const GAMSModifier &modifier2=GAMSModifier(), const GAMSModifier &modifier3=GAMSModifier())
bool operator==(const GAMSModelInstance &other) const
GAMSCheckpoint checkpoint()
void instantiate(const std::string &modelDefinition, const std::vector< gams::GAMSModifier > &modifiers={ })
void solve(std::ostream &output)
GAMSEnum::ModelStat modelStatus()
Get model state.
GAMSModelInstance & operator=(const GAMSModelInstance &other)
GAMSModelInstance copyModelInstance(std::string modelInstanceName="")
GAMSDatabase syncDb()
Retrieve GAMSDatabase used to synchronize modifiable data.
GAMSModelInstance()
Standard constructor.
Definition: gams.h:91