Class ProductionOptimizer.OptimizationObjective
java.lang.Object
neqsim.process.util.optimizer.ProductionOptimizer.OptimizationObjective
- Enclosing class:
ProductionOptimizer
Container for optimization objective configuration.
An objective defines a quantity to optimize (maximize or minimize) during the optimization process. Multiple objectives can be combined with weights to form a composite score.
Java Example
OptimizationObjective throughput = new OptimizationObjective("throughput",
proc -> proc.getUnit("outlet").getFlowRate("kg/hr"), 1.0, ObjectiveType.MAXIMIZE);
Python Example (via JPype)
from jpype import JImplements, JOverride
@JImplements("java.util.function.ToDoubleFunction")
class ThroughputEvaluator:
@JOverride
def applyAsDouble(self, proc):
return proc.getUnit("outlet").getFlowRate("kg/hr")
throughput = OptimizationObjective("throughput", ThroughputEvaluator(), 1.0)
- Version:
- 1.0
- Author:
- NeqSim Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ToDoubleFunction<ProcessSystem> private final Stringprivate final ProductionOptimizer.ObjectiveTypeprivate final double -
Constructor Summary
ConstructorsConstructorDescriptionOptimizationObjective(String name, ToDoubleFunction<ProcessSystem> evaluator, double weight) Constructs an objective with MAXIMIZE direction.OptimizationObjective(String name, ToDoubleFunction<ProcessSystem> evaluator, double weight, ProductionOptimizer.ObjectiveType type) Constructs an objective with explicit direction. -
Method Summary
Modifier and TypeMethodDescriptiondoubleevaluate(ProcessSystem process) Evaluates the objective for the given process state.getName()Returns the objective name.getType()Returns the objective type (MAXIMIZE or MINIMIZE).doubleReturns the objective weight.
-
Field Details
-
name
-
evaluator
-
weight
private final double weight -
type
-
-
Constructor Details
-
OptimizationObjective
Constructs an objective with MAXIMIZE direction.- Parameters:
name- unique name for the objectiveevaluator- function to compute objective value from process stateweight- relative weight for composite scoring (typically 0.0-1.0)
-
OptimizationObjective
public OptimizationObjective(String name, ToDoubleFunction<ProcessSystem> evaluator, double weight, ProductionOptimizer.ObjectiveType type) Constructs an objective with explicit direction.- Parameters:
name- unique name for the objectiveevaluator- function to compute objective value from process stateweight- relative weight for composite scoring (typically 0.0-1.0)type- MAXIMIZE or MINIMIZE direction
-
-
Method Details
-
getName
-
getWeight
public double getWeight()Returns the objective weight.- Returns:
- weight value
-
getType
Returns the objective type (MAXIMIZE or MINIMIZE).- Returns:
- objective type
-
evaluate
Evaluates the objective for the given process state.- Parameters:
process- the process system to evaluate- Returns:
- computed objective value
-