Simulated Digital Twin State Object

ScaleOut Digital Twins™ can run a simulation in simulated time and process simulation digital twin models. A simulation model can either implement a workload generator for real-time digital twins or a pure simulation model.

Define the simulated digital twin state object. This state object will be stored in ScaleOut Digital Twins. When the simulation runs, an instance of this state object will be passed to the model’s SimulationProcessor along with a ProcessingContext and the current simulated time.

Define a heater that will monitor if the heater is on and increasing temperature.

// SimulatedHeater.java

public class SimulatedHeater extends DigitalTwinBase {
        static int HEATER_ACTIVE_DELAY_MS = 5000;
        static int HEATER_INACTIVE_DELAY_MS = 1000;
        private boolean _increase = false;
        private boolean _shutdown = false;
        public SimulatedHeater() {}
        public SimulatedHeater(boolean increase) {
                _increase = increase;
        }
        public boolean increaseTemperature() {
                return _increase;
        }
        public void setIncreaseTemperature(boolean flag) {
                _increase = flag;
        }
        public void shutdown() {
                _shutdown = true;
        }
        public boolean isShutdown() {
                return _shutdown;
        }
}