# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # The following cell should be removed when crestdsl is installed directly:

import sys
sys.path.append('../')

# make sure to not be flooded with logs
import logging
logging.basicConfig(level=logging.WARNING, format='%(levelname)s:%(name)s--%(message)s')  

# +
# import all modeling concepts
from crestdsl.model import *

# import the simulator
from crestdsl.simulation import Simulator

# import the plotting libraries that can visualise the CREST systems
from crestdsl.ui import elk

# we will create tests for each Entity
import unittest

class TestClass(unittest.TestCase):
    @classmethod
    def runall(cls):
        tests = unittest.TestLoader().loadTestsFromTestCase(cls)
        return unittest.TextTestRunner().run(tests)
    


# + code_folding=[]
res_electricity = Resource("Watt", REAL)
res_heat_energy = Resource("Watt", REAL)
res_celsius = Resource("Celsius", REAL)
res_volume = Resource("m^3", REAL)
res_onoff_switch = Resource("onOffSwitch", ["on", "off"])
res_four_switch = Resource("fourSwitch", ["one", "two", "three", "off"])
res_time = Resource("minutes", REAL)
res_lux = Resource("lux", INTEGER)
res_integer = Resource("integer", INTEGER)
res_bool = Resource("bool", BOOL)
res_presence = Resource("presence", ["detected", "no presence"])
res_onoffauto = Resource("onOffAutoSwitch", ["on", "off", "auto"])


# -

class ElectricalDevice(object):
    electricity_in = Input(res_electricity, value=0)
    req_electricity_out = Output(res_electricity, value=0)


# +
# we will create tests for each Entity
import unittest

class TestClass(unittest.TestCase):
    @classmethod
    def runall(cls):
        tests = unittest.TestLoader().loadTestsFromTestCase(cls)
        return unittest.TextTestRunner().run(tests)
        
# -



StarcoderdataJupyterScriptsDedupFiltered