henze-research-group / MODRLC

The Advanced Controls Test Bed (ACTB) is a virtual buildings test bed that interfaces external controllers to high-fidelity Spawn of EnergyPlus models.
26 stars 9 forks source link

Migrate to BOPTEST core #51

Closed mattrobmattrob closed 4 months ago

mattrobmattrob commented 7 months ago

Separate the distinct functionality of the ACTB from the inherent capabilities of BOPTEST. This should reduce the code in the repo and rely as much as possible the https://github.com/ibpsa/project1-boptest to spin up the BOPTEST server.

graph LR;
    subgraph actb [Advanced Controls Test Bed - ACTB]
            A --> D[actb_client];
            B --> B2;
            B2 --> D;
            C --> D;
        subgraph actb_examples [ACTB Example Controllers]
            A[RBC];
            B[RLC];
            B2[ACTB Gym Interface];
            C[MPC];
        end
    end
    actb <--> N[boptest-service];
    subgraph nrel_repo [NREL]
            N <--> P[BOPTEST]
            style nrel_repo fill:#2A6CB8,color:#FFFFFF
        subgraph ibpsa_repo [IBPSA]
            style ibpsa_repo fill:#E92F19,color:#FFFFFF
            P
        end
    end
mattrobmattrob commented 6 months ago

Discussion WRT using the BOPTEST repo within the context of another in https://groups.google.com/g/ibpsa-boptest/c/eLejV78LvCo/m/T-uu8k7BCAAJ?utm_medium=email&utm_source=footer

mattrobmattrob commented 6 months ago

Handle https://github.com/ibpsa/project1-boptest/pull/508 and https://github.com/ibpsa/project1-boptest/issues/356.

https://github.com/ibpsa/project1-boptest/blob/2b4328c1607f80a35890968fcac54d7d6c60b965/forecast/forecaster.py#L33-L35

mattrobmattrob commented 5 months ago

Issue when using modelica-buildings Spawn/EP version in compilation then BOPTEST Spawn version when initialization:

FMIL: module = Model, log level = 3: [WARNING][FMU status:Warning]     <ModelicaMessage category="warning"><value name="msg">"259200.000 wrapped.mod.building: Found executable 'spawn-0.3.0-8d93151657' in '/usr/local/bin'.&#10;"</value></ModelicaMessage>
FMIL: module = Model, log level = 3: [WARNING][FMU status:Warning]     <ModelicaMessage category="warning"><value name="msg">"259200.000 wrapped.mod.building: Entered generateFMU with FMUPath = /simulate/f9bcf140-162c-4859-9a80-611cf2929df5/EnergyPlus-simulation-wrapped.mod.building/wrapped.mod.building.fmu.&#10;"</value></ModelicaMessage>
FMIL: module = Model, log level = 3: [WARNING][FMU status:Warning]     <ModelicaMessage category="warning"><value name="msg">"259200.000 wrapped.mod.building: Executing ""/usr/local/bin/spawn-0.3.0-8d93151657"" --no-compress  --output-path ""/simulate/f9bcf140-162c-4859-9a80-611cf2929df5/EnergyPlus-simulation-wrapped.mod.building/wrapped.mod.building.fmu"" --create ""/simulate/f9bcf140-162c-4859-9a80-611cf2929df5/EnergyPlus-simulation-wrapped.mod.building/ModelicaBuildingsEnergyPlus.json""&#10;"</value></ModelicaMessage>
FMIL: module = Model, log level = 3: [WARNING][FMU status:Warning]     <ModelicaError category="warning"><value name="msg">"259200.000 wrapped.mod.building: Executing '""/usr/local/bin/spawn-0.3.0-8d93151657"" --no-compress  --output-path ""/simulate/f9bcf140-162c-4859-9a80-611cf2929df5/EnergyPlus-simulation-wrapped.mod.building/wrapped.mod.building.fmu"" --create ""/simulate/f9bcf140-162c-4859-9a80-611cf2929df5/EnergyPlus-simulation-wrapped.mod.building/ModelicaBuildingsEnergyPlus.json""' failed to generate fmu '/simulate/f9bcf140-162c-4859-9a80-611cf2929df5/EnergyPlus-simulation-wrapped.mod.building/wrapped.mod.building.fmu'."</value></ModelicaError>

Using declared Spawn version and log level increase in SpawnRefSmallOfficeBuilding.mo:

  inner Buildings.ThermalZones.EnergyPlus.Building building(
    idfName=Modelica.Utilities.Files.loadResource(
        "Resources/RefBldgSmallOfficeNew2004_v2.idf"),
    weaName=Modelica.Utilities.Files.loadResource(
        "Resources/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"),
    epwName=Modelica.Utilities.Files.loadResource(
        "Resources/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"),
    logLevel=Buildings.ThermalZones.EnergyPlus.Types.LogLevels.Debug,
    spawnExe="spawn-0.3.0-8d93151657",
mattrobmattrob commented 5 months ago

Grabbed the uploaded Spawn binary versions from https://spawn.s3.amazonaws.com. ACTB is currently using:

<Contents>
    <Key>builds/Spawn-0.2.0-d7f1e095f3-Linux.tar.gz</Key>
    <LastModified>2021-11-03T00:08:36.000Z</LastModified>
    <ETag>"fdc93fc383b52a35667473a2909ae898-38"</ETag>
    <Size>318765357</Size>
    <StorageClass>STANDARD</StorageClass>
</Contents>