Class DynamicLogicExample

java.lang.Object
neqsim.process.util.example.DynamicLogicExample

public class DynamicLogicExample extends Object
Example demonstrating how to create process logic completely dynamically at runtime without any pre-compiled logic sequences.

This shows:

  • Creating custom actions with lambda expressions
  • Creating custom conditions with anonymous classes
  • Building complex logic sequences programmatically
  • Runtime logic modification and adaptation
Version:
1.0
Author:
ESOL
  • Constructor Details

    • DynamicLogicExample

      public DynamicLogicExample()
  • Method Details

    • main

      public static void main(String[] args)
    • createSimpleProcess

      private static ProcessSystem createSimpleProcess()
      Creates a simple process for demonstration.
      Returns:
      the created ProcessSystem with feed, valve, and separator
    • demonstrateCustomActions

      private static void demonstrateCustomActions(ThrottlingValve valve, Separator separator)
      Demonstrates creating custom actions at runtime.
      Parameters:
      valve - the ThrottlingValve to control in custom actions
      separator - the Separator to control in custom actions
    • demonstrateCustomConditions

      private static void demonstrateCustomConditions(ThrottlingValve valve, Separator separator)
      Demonstrates creating custom conditions at runtime.
      Parameters:
      valve - the ThrottlingValve to monitor in custom conditions
      separator - the Separator to monitor in custom conditions
    • demonstrateDynamicLogicSequences

      private static void demonstrateDynamicLogicSequences(ThrottlingValve valve, Separator separator)
      Demonstrates building complex logic sequences completely at runtime.
      Parameters:
      valve - the throttling valve to control
      separator - the separator to monitor
    • demonstrateRuntimeModification

      private static void demonstrateRuntimeModification(ThrottlingValve valve, Separator separator)
      Demonstrates modifying logic sequences at runtime.
      Parameters:
      valve - the throttling valve to control
      separator - the separator to monitor
    • determineRuntimeScenario

      private static String determineRuntimeScenario()
      Simulates determining what scenario to use at runtime.
      Returns:
      the determined runtime scenario name
    • createAdaptiveLogic

      private static ESDLogic createAdaptiveLogic(String scenario, ThrottlingValve valve, Separator separator)
      Creates adaptive logic based on runtime scenario.
      Parameters:
      scenario - the scenario name to determine logic behavior
      valve - the ThrottlingValve to control
      separator - the Separator to control
      Returns:
      the created ESDLogic configured for the given scenario
    • createAdaptiveAction

      private static LogicAction createAdaptiveAction(String description, ProcessEquipmentInterface equipment, double parameter)
      Factory method for creating adaptive actions.
      Parameters:
      description - the description of the action
      equipment - the equipment to control
      parameter - the parameter value for the action (valve opening or -1 for mode switch)
      Returns:
      the created LogicAction