gams::GAMSCheckpoint Class Reference

#include <gamscheckpoint.h>

Public Member Functions

 GAMSCheckpoint ()
 Standard constructor. More...
 
 GAMSCheckpoint (const GAMSCheckpoint &other)
 
 GAMSCheckpoint (const GAMSWorkspace &ws, const std::string &checkpointName="")
 
GAMSCheckpointoperator= (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 47 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
otherGAMSCheckpoint used to initialize the new GAMSCheckpoint.

◆ GAMSCheckpoint() [3/3]

gams::GAMSCheckpoint::GAMSCheckpoint ( const GAMSWorkspace ws,
const std::string &  checkpointName = "" 
)

Constructor.

Parameters
wsGAMSWorkspace containing GAMSCheckpoint.
checkpointNameIdentifier of GAMSCheckpoint (determined automatically if omitted)

Member Function Documentation

◆ addModelInstance()

GAMSModelInstance gams::GAMSCheckpoint::addModelInstance ( const std::string &  modelInstanceName = "")

Create model instance.

Parameters
modelInstanceNameIdentifier 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; otherwise false.

◆ 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
otherAnother GAMSCheckpoint to compare to.
Returns
Returns true if the two GAMSCheckpoint are different; otherwise false.

◆ operator=()

GAMSCheckpoint& gams::GAMSCheckpoint::operator= ( const GAMSCheckpoint other)

Assigns a GAMSCheckpoint.

Parameters
otherAnother 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
otherAnother GAMSCheckpoint to compare to.
Returns
Returns true if the two GAMSCheckpoint are equal; otherwise false.

◆ workspace()

GAMSWorkspace gams::GAMSCheckpoint::workspace ( )

Get the GAMSWorkspace.

Returns
Returns the GAMSWorkspace.