[ library(eplex) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

lp_set(++ParamName, ++Value)

Set a global parameter for the external solver.
Integer, float, string or structure


Set a global parameter. The parameter names are the same as described in lp_get/2. For the timeout parameter, Value can be of any numeric type. Note that for the external solver's parameters (set via optimizer_param(Param)), the exact behaviour is solver dependent: if the solver has global parameters, this sets the value of the parameter globally; otherwise, this sets the default value of the parameter that would be assigned to a new problem. The setting is not undone on backtracking.

This behaviour was changed from that of previous (pre 5.4) versions of ECLiPSe, as all solvers had global parameters, and thus there were no setting of default values. Code developed under these older versions may no longer be setting the external solver's parameters correctly. Thus when lp_set/2 sets a default setting, an event lp_set_default_warning is raised to warn the user about the difference. This event can be suppressed by the directive

        :- set_event_handler(lp_set_default_warning, true/0)

In addition, lp_set/2 is used to control the output from the external solver:

lp_set(SolverChannel, +(Stream))
Send output from SolverChannel to the ECLiPSe I/O stream Stream.
lp_set(SolverChannel, -(Stream))
Stop sending output from SolverChannel to the ECLiPSe I/O stream Stream.
SolverChannel is one of result_channel, error_channel, warning_channel, log_channel, and Stream is an ECLiPSe stream identifier (e.g. output, or the result of an open/3 operation).

By default, error_channel is directed to ECLiPSe's error stream, warning_channel to warning_output while result_channel and log_channel are suppressed. To see the output on these channels, do

   :- lp_set(result_channel, +output).
   :- lp_set(log_channel, +log_output).

Similarly, to create a log file:

   :- open('mylog.log', write, logstream), lp_set(log_channel, +logstream).
and to stop logging:
   :- lp_set(log_channel, -logstream), close(logstream).



See Also

lp_get / 2