コード例 #1
0
    def __init__(self):
        self.generate()
        self.ConsumptionYearly = profilegentools.gaussMinMax(
            3360, 600
        ) * config.consumptionFactor  #kWh http://www.nibud.nl/uitgaven/huishouden/gas-elektriciteit-en-water.html

        age = random.triangular(65, 85, 70)
        self.Persons = [persons.PersonRetired(age), persons.PersonRetired(age)]

        if (random.randint(1, 2) == 1):
            self.Fridges = [
                devices.DeviceFridge(
                    random.randint(config.ConsumptionFridgeBigMin,
                                   config.ConsumptionFridgeBigMax))
            ]
        else:
            self.Fridges = [
                devices.DeviceFridge(
                    random.randint(config.ConsumptionFridgeSmallMin,
                                   config.ConsumptionFridgeSmallMax)),
                devices.DeviceFridge(
                    random.randint(config.ConsumptionFridgeSmallMin,
                                   config.ConsumptionFridgeSmallMax))
            ]

        self.hasDishwasher = random.randint(0, 5) < 3  #40%

        #Determine washing days
        self.generateWashingdays(random.randint(3, 4))

        #Dermine Dishwasher times
        if self.hasDishwasher:
            self.generateDishwashdays(3)
コード例 #2
0
    def __init__(self):
        self.generate()
        self.ConsumptionYearly = profilegentools.gaussMinMax(
            3360, 600
        ) * config.consumptionFactor  #kWh http://www.nibud.nl/uitgaven/huishouden/gas-elektriciteit-en-water.html

        age = random.triangular(65, 85, 70)
        self.Persons = [persons.PersonRetired(age), persons.PersonRetired(age)]

        #To make life easy, only one persons.Person will use the electric vehicle, so only the main persons.Person will receive a driving distance
        self.Persons[0].setDistanceToWork(
            round(
                max(
                    0,
                    random.gauss(config.commuteDistanceMean,
                                 config.commuteDistanceSigma))))

        if (random.randint(1, 2) == 1):
            self.Fridges = [
                devices.DeviceFridge(
                    random.randint(config.ConsumptionFridgeBigMin,
                                   config.ConsumptionFridgeBigMax))
            ]
        else:
            self.Fridges = [
                devices.DeviceFridge(
                    random.randint(config.ConsumptionFridgeSmallMin,
                                   config.ConsumptionFridgeSmallMax)),
                devices.DeviceFridge(
                    random.randint(config.ConsumptionFridgeSmallMin,
                                   config.ConsumptionFridgeSmallMax))
            ]

        self.hasDishwasher = random.randint(0, 5) < 3  #40%

        #Determine washing days
        self.generateWashingdays(random.randint(3, 4))

        #Dermine Dishwasher times
        if self.hasDishwasher:
            self.generateDishwashdays(3)