Class SeparatorLevelControlEnv
java.lang.Object
neqsim.process.ml.RLEnvironment
neqsim.process.ml.examples.SeparatorLevelControlEnv
- All Implemented Interfaces:
Serializable
Example RL environment for separator level control.
This demonstrates how to wrap a NeqSim process in an RL-compatible interface for training control policies. The agent learns to maintain liquid level at setpoint by controlling the liquid outlet valve.
State Space:
- liquid_level: Current level fraction [0, 1]
- pressure: Separator pressure [bar]
- temperature: Separator temperature [K]
- feed_flow: Inlet flow rate [kg/s]
- gas_density: Gas phase density [kg/m³]
- liquid_density: Liquid phase density [kg/m³]
- level_error: Deviation from setpoint [-1, 1]
- pressure_error: Deviation from pressure setpoint [-1, 1]
Action Space:
- valve_opening: Liquid outlet valve position [0, 1]
Reward:
- Negative quadratic penalty for level error
- Negative penalty for constraint violations
- Positive reward for stability (low action changes)
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class RLEnvironment
RLEnvironment.StepInfo, RLEnvironment.StepResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Streamprivate doubleprivate ThrottlingValveprivate doubleprivate doubleprivate Separatorprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionCreate a separator level control environment with default process.SeparatorLevelControlEnv(ProcessSystem process, String separatorName, String valveName, String feedName) Create a separator level control environment with custom process. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyAction(ActionVector action) Apply action to process equipment.protected doublecomputeReward(StateVector state, ActionVector action, RLEnvironment.StepInfo info) Compute reward for current state and action.private static ProcessSystemGet the liquid outlet valve.protected StateVectorGet current observation.Get the separator being controlled.private voidstatic voidDemo main method.voidsetLevelSetpoint(double setpoint) Set the level setpoint.voidsetPressureSetpoint(double setpoint) Set the pressure setpoint.Methods inherited from class RLEnvironment
addConstraint, defineAction, getActionSpace, getConstraintManager, getCurrentTime, getProcess, getStepCount, isDone, reset, setMaxEpisodeTime, setRewardWeights, setTimeStep, step
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
separator
-
liquidValve
-
feedStream
-
levelSetpoint
private double levelSetpoint -
pressureSetpoint
private double pressureSetpoint -
previousAction
private double previousAction
-
-
Constructor Details
-
SeparatorLevelControlEnv
public SeparatorLevelControlEnv()Create a separator level control environment with default process. -
SeparatorLevelControlEnv
public SeparatorLevelControlEnv(ProcessSystem process, String separatorName, String valveName, String feedName) Create a separator level control environment with custom process.- Parameters:
process- the process system containing a separatorseparatorName- name of the separator in the processvalveName- name of the liquid outlet valvefeedName- name of the feed stream
-
-
Method Details
-
createDefaultProcess
-
initializeComponents
private void initializeComponents() -
setLevelSetpoint
public void setLevelSetpoint(double setpoint) Set the level setpoint.- Parameters:
setpoint- target level fraction [0, 1]
-
setPressureSetpoint
public void setPressureSetpoint(double setpoint) Set the pressure setpoint.- Parameters:
setpoint- target pressure [bar]
-
applyAction
Description copied from class:RLEnvironmentApply action to process equipment. Override in subclass to implement specific control logic.- Overrides:
applyActionin classRLEnvironment- Parameters:
action- the action to apply
-
getObservation
Description copied from class:RLEnvironmentGet current observation. Override in subclass to include equipment-specific states.- Overrides:
getObservationin classRLEnvironment- Returns:
- current state vector
-
computeReward
Description copied from class:RLEnvironmentCompute reward for current state and action.- Overrides:
computeRewardin classRLEnvironment- Parameters:
state- current stateaction- applied actioninfo- info object to fill with details- Returns:
- scalar reward
-
getSeparator
-
getLiquidValve
-
main
-