99import it .wldt .core .event .DefaultWldtEventLogger ;
1010import it .wldt .core .event .EventManager ;
1111import it .wldt .core .event .WldtEventBus ;
12- import it .wldt .core .model .ModelEngine ;
12+ import it .wldt .core .model .DigitalTwinModel ;
1313import it .wldt .core .model .ShadowingFunction ;
1414import it .wldt .core .model .ShadowingModelListener ;
1515import it .wldt .core .state .DigitalTwinState ;
@@ -101,7 +101,7 @@ public class DigitalTwin implements ShadowingModelListener, PhysicalAdapterListe
101101 /**
102102 * Instance of the Model Engine of the current Digital Twin
103103 */
104- private ModelEngine modelEngine = null ;
104+ private DigitalTwinModel digitalTwinModel = null ;
105105
106106 /**
107107 * List of Life Cycle Listener for the current Digital Twin
@@ -232,11 +232,11 @@ private void init(ShadowingFunction shadowingFunction) throws ModelException, Wl
232232 this .shadowingFunction = shadowingFunction ;
233233 this .shadowingFunction .setShadowingModelListener (this );
234234
235- // Initialize the Digital Twin Model with digital twin ID, state manager, and shadowing function
236- this .modelEngine = new ModelEngine (this .digitalTwinId , this .digitalTwinStateManager , this .shadowingFunction );
235+ // Initialize the Digital Twin Model with digital twin ID, state manager, shadowing function, and storage manager
236+ this .digitalTwinModel = new DigitalTwinModel (this .digitalTwinId , this .digitalTwinStateManager , this .shadowingFunction , this . storageManager );
237237
238238 //Save the Model Engine as Digital Twin Life Cycle Listener
239- addLifeCycleListener (this .modelEngine );
239+ addLifeCycleListener (this .digitalTwinModel );
240240
241241 // Execute Storage Manager
242242 executeStorageManager ();
@@ -246,7 +246,7 @@ private void init(ShadowingFunction shadowingFunction) throws ModelException, Wl
246246 * Executes the model engine in a dedicated thread.
247247 */
248248 private void executeModelEngine (){
249- modelEngineThread = new Thread (this .modelEngine );
249+ modelEngineThread = new Thread (this .digitalTwinModel );
250250 modelEngineThread .setName (String .format ("%s-model-engine" , this .getId ()));
251251 modelEngineThread .start ();
252252 }
@@ -632,8 +632,8 @@ protected void stopLifeCycle(){
632632 //Stop and Notify Model Engine
633633 this .modelEngineThread .interrupt ();
634634 this .modelEngineThread = null ;
635- this .modelEngine .onWorkerStop ();
636- removeLifeCycleListener (this .modelEngine );
635+ this .digitalTwinModel .onWorkerStop ();
636+ removeLifeCycleListener (this .digitalTwinModel );
637637
638638 //Stop and Notify Physical Adapters
639639 this .physicalAdapterExecutor .shutdownNow ();
0 commit comments