Gnm.Solver¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Time the solver finished |
||
r/w |
Flip sign of target |
||
r/w/co |
Solver parameters |
||
r/w |
The reason behind the solver’s status |
||
r/w |
Current best feasible result |
||
r/w |
Sensitivity results |
||
r/w |
Time the solver was started |
||
r/w |
The solver’s current status |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
discrete |
r |
||
endtime |
r |
||
flip_sign |
r |
||
gradient |
[ |
r |
|
gradient_status |
r |
||
hessian |
[ |
r |
|
hessian_status |
r |
||
index_from_cell |
r |
||
input_cells |
[ |
r |
|
max |
r |
||
min |
r |
||
params |
r |
||
parent |
r |
||
reason |
r |
||
result |
r |
||
sensitivity |
r |
||
starttime |
r |
||
status |
r |
||
target |
r |
Class Details¶
- class Gnm.Solver(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod db_get()¶
- Returns:
list of registered solver factories.
- Return type:
- classmethod db_register(factory)¶
- Parameters:
factory (
Gnm.SolverFactory
) –
- classmethod db_unregister(factory)¶
- Parameters:
factory (
Gnm.SolverFactory
) –
- compute_hessian(xs)¶
- Parameters:
xs (
float
) – Point to compute Hessian at- Returns:
A matrix containing the Hessian. This function takes the flip-sign property into account.
- Return type:
- get_target_value()¶
- Returns:
the current
GOffice.value
of the target cell, possibly with the sign flipped.- Return type:
- has_analytic_gradient()¶
- has_analytic_hessian()¶
- line_search(x0, dir, try_reverse, step, max_step, eps)¶
- Parameters:
- Returns:
optimal step size.
- py:
location to store resulting objective function
GOffice.value
- Return type:
- pick_lp_coords()¶
- Returns:
- px1:
first coordinate
GOffice.value
- px2:
second coordinate
GOffice.value
- Return type:
Pick two good values for each coordinate. We prefer 0 and 1 when they are valid.
- prepare(wbc)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) – control for user interaction- Raises:
- Returns:
- Return type:
Prepare for solving. Preparation need not do anything, but may include such tasks as checking that the model is valid for the solver and locating necessary external programs.
- saveas(wbc, fs, templ, filename)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) –fs (
GOffice.FileSaver
) –templ (
str
) –filename (
str
) –
- Raises:
- Return type:
- set_status(status)¶
- Parameters:
status (
Gnm.SolverStatus
) –
- start(wbc)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) – control for user interaction- Raises:
- Returns:
- Return type:
Start the solving process. If needed, the solver will be prepared first.
- stop()¶
- Raises:
- Returns:
- Return type:
Terminate the currently-running solver.
- store_result()¶
- do_prepare(wbc) virtual¶
- Parameters:
wbc (
Gnm.WorkbookControl
) – control for user interaction- Returns:
- Return type:
Prepare for solving. Preparation need not do anything, but may include such tasks as checking that the model is valid for the solver and locating necessary external programs.
- do_start(wbc) virtual¶
- Parameters:
wbc (
Gnm.WorkbookControl
) – control for user interaction- Returns:
- Return type:
Start the solving process. If needed, the solver will be prepared first.
Signal Details¶
- Gnm.Solver.signals.prepare(solver, object, p0)¶
- Signal Name:
prepare
- Flags:
- Parameters:
solver (
Gnm.Solver
) – The object which received the signalobject (
GObject.Object
) –
- Return type:
- Gnm.Solver.signals.start(solver, object, p0)¶
- Signal Name:
start
- Flags:
- Parameters:
solver (
Gnm.Solver
) – The object which received the signalobject (
GObject.Object
) –
- Return type:
Property Details¶
- Gnm.Solver.props.endtime¶
-
Time the solver finished
- Gnm.Solver.props.flip_sign¶
-
Flip sign of target
GOffice.value
- Gnm.Solver.props.params¶
- Name:
params
- Type:
- Default Value:
- Flags:
Solver parameters
- Gnm.Solver.props.reason¶
-
The reason behind the solver’s status
- Gnm.Solver.props.result¶
- Name:
result
- Type:
- Default Value:
- Flags:
Current best feasible result
- Gnm.Solver.props.sensitivity¶
- Name:
sensitivity
- Type:
- Default Value:
- Flags:
Sensitivity results
- Gnm.Solver.props.starttime¶
-
Time the solver was started
- Gnm.Solver.props.status¶
- Name:
status
- Type:
- Default Value:
- Flags:
The solver’s current status