A parameter set object for use with multi-objective optimization.
A parameter set consists of key-value pairs where the key is a CPLEX
parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated
parameter value.
When adding, getting, or deleting items from a parameter set the
param argument can be either a Parameter object (e.g,
Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND
(1001)).
For more details see the section on multi-objective optimization in
the CPLEX User's Manual.
get_ids(self)
Gets the parameter IDs contained in a parameter set.
delete(self,
param)
Deletes a parameter from a parameter set.
clear(self)
Clears all items from the parameter set.
__len__(self)
Return the number of items in the parameter set.
read(self,
filename)
Reads parameter names and settings from the file specified by
filename and copies them into the parameter set.
write(self,
filename)
Writes a parameter file that contains the parameters in the
parameter set.
Method Details
__init__(self,
env) (Constructor)
Constructor of the ParameterSet class.
This class is not meant to be instantiated directly nor used
externally.
end(self)
Releases the ParameterSet object.
Frees all data structures associated with a ParameterSet. After
a call of the method end(), the invoking object can no longer be
used. Attempts to use them subsequently raise a ValueError.
Reads parameter names and settings from the file specified by
filename and copies them into the parameter set.
Note that the content of the parameter set is not cleared out
before the parameters in the file are copied into the parameter
set. The parameters are read from the file one by one and are
added to the parameter set, or, if the parameter was already
present in the set, then its value is updated.
This routine reads and copies files in the PRM format, as created
by Cplex.parameters.write. The PRM format is documented in the
CPLEX File Formats Reference Manual.
Example usage:
>>> import cplex
>>> c = cplex.Cplex()
>>> c.parameters.advance.set(c.parameters.advance.values.none)
>>> c.parameters.write_file('example.prm')
>>> ps = c.create_parameter_set()
>>> ps.read('example.prm')
>>> value = ps.get(c.parameters.advance)
>>> value == c.parameters.advance.values.none
True
write(self,
filename)
Writes a parameter file that contains the parameters in the
parameter set.
This routine writes a file in a format suitable for reading by
ParameterSet.read or by Cplex.parameters.read.
The file is written in the PRM format which is documented in the
CPLEX File Formats Reference Manual.
Example usage:
>>> import cplex
>>> c = cplex.Cplex()
>>> ps = c.create_parameter_set()
>>> ps.add(c.parameters.advance,
... c.parameters.advance.values.none)
>>> ps.write('example.prm')
>>> c.parameters.read_file('example.prm')
>>> value = c.parameters.advance.get()
>>> value == c.parameters.advance.values.none
True