#include <gamscheckpoint.h>
Public Member Functions | |
GAMSCheckpoint () | |
Standard constructor. | |
GAMSCheckpoint (const GAMSCheckpoint &other) | |
GAMSCheckpoint (const GAMSWorkspace &ws, const std::string &checkpointName="") | |
GAMSCheckpoint & | operator= (const GAMSCheckpoint &other) |
bool | operator!= (const GAMSCheckpoint &other) const |
bool | operator== (const GAMSCheckpoint &other) const |
GAMSModelInstance | addModelInstance (const std::string &modelInstanceName="") |
std::string | name () |
GAMSWorkspace | workspace () |
gams::LogId | logID () |
bool | isValid () const |
std::string | fileName () const |
Detailed Description
A GAMSCheckpoint class captures the state of a GAMSJob after the GAMSJob.run method has been carried out. Another GAMSJob can continue (or restart) from a GAMSCheckpoint. A GAMSCheckpoint constructed with a file name will create a file (extension .g00) for permanent storage when supplied as parameter on the GAMSJob.run method. Moreover, a GAMSModelInstance is also initialized from a checkpoint that contains the model definition of the model instance.
Definition at line 46 of file gamscheckpoint.h.
Constructor & Destructor Documentation
◆ GAMSCheckpoint() [1/3]
gams::GAMSCheckpoint::GAMSCheckpoint | ( | ) |
Standard constructor.
◆ GAMSCheckpoint() [2/3]
gams::GAMSCheckpoint::GAMSCheckpoint | ( | const GAMSCheckpoint & | other | ) |
Copy constructor.
- Parameters
-
other GAMSCheckpoint used to initialize the new GAMSCheckpoint.
◆ GAMSCheckpoint() [3/3]
gams::GAMSCheckpoint::GAMSCheckpoint | ( | const GAMSWorkspace & | ws, |
const std::string & | checkpointName = "" |
||
) |
Constructor.
- Parameters
-
ws GAMSWorkspace containing GAMSCheckpoint. checkpointName Identifier of GAMSCheckpoint (determined automatically if omitted)
Member Function Documentation
◆ addModelInstance()
GAMSModelInstance gams::GAMSCheckpoint::addModelInstance | ( | const std::string & | modelInstanceName = "" | ) |
Create model instance.
- Parameters
-
modelInstanceName Identifier of GAMSModelInstance (determined automatically if omitted).
- Returns
- Returns the GAMSModelInstance.
◆ fileName()
std::string gams::GAMSCheckpoint::fileName | ( | ) | const |
Get the checkpoint file name.
- Returns
- Returns the checkpoint file name.
◆ isValid()
bool gams::GAMSCheckpoint::isValid | ( | ) | const |
Checks if a GAMSCheckpoint is valid.
- Returns
- Returns
true
if the GAMSCheckpoint is valid; otherwisefalse
.
◆ logID()
gams::LogId gams::GAMSCheckpoint::logID | ( | ) |
Get the GAMS log ID.
- Returns
- Returns the GAMS log ID.
◆ name()
std::string gams::GAMSCheckpoint::name | ( | ) |
Get the checkpoint name.
- Returns
- Returns the checkpoint name.
◆ operator!=()
bool gams::GAMSCheckpoint::operator!= | ( | const GAMSCheckpoint & | other | ) | const |
Compares two GAMSCheckpoint objects.
- Parameters
-
other Another GAMSCheckpoint to compare to.
- Returns
- Returns
true
if the two GAMSCheckpoint are different; otherwisefalse
.
◆ operator=()
GAMSCheckpoint & gams::GAMSCheckpoint::operator= | ( | const GAMSCheckpoint & | other | ) |
Assigns a GAMSCheckpoint.
- Parameters
-
other Another GAMSCheckpoint used as data source.
- Returns
- Returns the assigned GAMSCheckpoint (*this).
◆ operator==()
bool gams::GAMSCheckpoint::operator== | ( | const GAMSCheckpoint & | other | ) | const |
Compares two GAMSCheckpoint objects.
- Parameters
-
other Another GAMSCheckpoint to compare to.
- Returns
- Returns
true
if the two GAMSCheckpoint are equal; otherwisefalse
.
◆ workspace()
GAMSWorkspace gams::GAMSCheckpoint::workspace | ( | ) |
Get the GAMSWorkspace.
- Returns
- Returns the GAMSWorkspace.