From 689f3ac898031b0fa8b7d2ebd58730f1f1712dda Mon Sep 17 00:00:00 2001 From: Erik van Velzen Date: Mon, 18 May 2026 12:56:13 +0200 Subject: [PATCH] Remove getExperiment calls getExperiment() is called just to get the AnyLogic Engine even though every agent already has a reference to the Engine. With this change it's easier to use Lux without instantiating an experiment. --- _alp/Agents/EnergyModel/Code/Functions.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_alp/Agents/EnergyModel/Code/Functions.java b/_alp/Agents/EnergyModel/Code/Functions.java index bb32aef..d56b4fc 100644 --- a/_alp/Agents/EnergyModel/Code/Functions.java +++ b/_alp/Agents/EnergyModel/Code/Functions.java @@ -554,7 +554,7 @@ ArrayList f_getActiveGridConnections() startDate.setMinutes(0); traceln("Startdate: %s", startDate); //startDate.set -getExperiment().getEngine().setStartDate(startDate); +getEngine().setStartDate(startDate); */ //traceln("Day of the week on january 1st %s: %s, int value: %s", p_year, DayOfWeek.from(localDate).name(), v_dayOfWeek1jan); @@ -1055,7 +1055,7 @@ EnergyCoop f_addProductionEnergyCarrier(OL_EnergyCarriers EC) startDate.setMinutes(0); traceln("Startdate: %s", startDate); //startDate.set -getExperiment().getEngine().setStartDate(startDate); +getEngine().setStartDate(startDate); */ f_initializeForecasts(); @@ -1163,7 +1163,7 @@ List f_getPausedGridConnectionsCollectionPointer() Date f_getDate() {/*ALCODESTART::1758012535712*/ -Date startDate = getExperiment().getEngine().getStartDate(); +Date startDate = getEngine().getStartDate(); long startDateUnixTime_ms = startDate.getTime(); long runtime_ms = (long) (v_timeStepsElapsed * p_timeParameters.getTimeStep_h() * 60 * 60 * 1000); Date date = new Date(); @@ -1223,7 +1223,7 @@ Date f_getDate() startDate.setMinutes(0); traceln("Startdate: %s", startDate); //startDate.set -getExperiment().getEngine().setStartDate(startDate); +getEngine().setStartDate(startDate); @@ -1305,7 +1305,7 @@ ArrayList f_getAllGridConnections() startDate.setMinutes(0); traceln("Startdate: %s", startDate); //startDate.set -getExperiment().getEngine().setStartDate(startDate); +getEngine().setStartDate(startDate); /*ALCODEEND*/}