Trees | Indices | Help |
|
---|
|
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
Properties | |
Inherited from |
Method Details |
Creates a new SensitivityInterface. The sensitivity interface is exposed by the top-level Cplex class as Cplex.solution.sensitivity. This constructor is not meant to be used externally.
|
Returns the sensitivity of a set of lower bounds. Can be called by four forms. >>> import cplex >>> c = cplex.Cplex() >>> out = c.set_results_stream(None) >>> out = c.set_log_stream(None) >>> c.read("example.mps") >>> c.solve() >>> c.solution.sensitivity.lower_bounds(1) (-1e+20, 17.5) >>> c.solution.sensitivity.lower_bounds('x3') (-1e+20, 42.5) >>> c.solution.sensitivity.lower_bounds(["x3", 0]) [(-1e+20, 42.5), (-1e+20, 40.0)] >>> c.solution.sensitivity.lower_bounds() [(-1e+20, 40.0), (-1e+20, 17.5), (-1e+20, 42.5), (-1e+20, 0.625)] |
Returns the sensitivity of a set of upper bounds. Can be called by four forms. >>> import cplex >>> c = cplex.Cplex() >>> out = c.set_results_stream(None) >>> out = c.set_log_stream(None) >>> c.read("example.mps") >>> c.solve() >>> c.solution.sensitivity.upper_bounds(1) (17.5, 1e+20) >>> c.solution.sensitivity.upper_bounds("x3") (42.5, 1e+20) >>> bupper = c.solution.sensitivity.upper_bounds(["x3", 0]) >>> for i, j in zip(bupper, [(42.5, 1e+20), (36.428571, 155.0)]): ... abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6 ... True True >>> bupper = c.solution.sensitivity.upper_bounds() >>> for i, j in zip(bupper[3], (0.625, 1e+20)): ... abs(i - j) < 1e-6 ... True True |
Returns the sensitivity of a set of both lower and upper bounds. Can be called by four forms. >>> import cplex >>> c = cplex.Cplex() >>> out = c.set_results_stream(None) >>> out = c.set_log_stream(None) >>> c.read("example.mps") >>> c.solve() >>> c.solution.sensitivity.bounds(1) (-1e+20, 17.5, 17.5, 1e+20) >>> c.solution.sensitivity.bounds("x3") (-1e+20, 42.5, 42.5, 1e+20) >>> c.solution.sensitivity.bounds(["x3", 1]) [(-1e+20, 42.5, 42.5, 1e+20), (-1e+20, 17.5, 17.5, 1e+20)] >>> bd = c.solution.sensitivity.bounds() >>> bd[1] (-1e+20, 17.5, 17.5, 1e+20) |
Returns the sensitivity of part of the objective function. Can be called by four forms. >>> import cplex >>> c = cplex.Cplex() >>> out = c.set_results_stream(None) >>> out = c.set_log_stream(None) >>> c.read("example.mps") >>> c.solve() >>> c.solution.sensitivity.objective(1) (-3.0, 5.0) >>> c.solution.sensitivity.objective("x3") (-1e+20, -2.0) >>> c.solution.sensitivity.objective(["x3", 1]) [(-1e+20, -2.0), (-3.0, 5.0)] >>> c.solution.sensitivity.objective() [(-1e+20, 2.5), (-3.0, 5.0), (-1e+20, -2.0), (0.0, 4.0)] |
Returns the sensitivity of the righthand side of a set of linear constraints. Can be called by four forms. >>> import cplex >>> c = cplex.Cplex() >>> out = c.set_results_stream(None) >>> out = c.set_log_stream(None) >>> c.read("example.mps") >>> c.solve() >>> rhssa = c.solution.sensitivity.rhs(1) >>> for i, j in zip(rhssa, (20.0, 46.666666)): ... abs(i - j) < 1e-6 ... True True >>> c.solution.sensitivity.rhs("c3") (-1e+20, 112.5) >>> rhssa = c.solution.sensitivity.rhs(["c3", 1]) >>> for i, j in zip(rhssa, [(-1e+20, 112.5), (20.0, 46.666666)]): ... abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6 ... True True >>> rhssa = c.solution.sensitivity.rhs() >>> for i, j in zip(rhssa[3], (-1e+20, 42.5)): ... abs(i - j) < 1e-6 ... True True |
Trees | Indices | Help |
|
---|