def __init__(self):
        #        print "init start hh"
        pycd3.Node.__init__(self)

        self.inport = pycd3.Flow()
        self.outport = pycd3.Flow()
        self.currentOutdoorDemand = pycd3.Flow()
        self.gardensize = pycd3.Flow()
        self.average = pycd3.Double(7)
        self.deviation = pycd3.Double(2)
        self.tap_flow_rate = pycd3.Double(18)
        self.smart_watering_time = pycd3.String("[18,6]")
        self.watering_method = pycd3.String('Smart_Watering')
        self.onoff = pycd3.String("Off")

        self.addInPort("Gardensize", self.gardensize)
        self.addInPort("Outdoor_Demand_In", self.inport)
        self.addOutPort("Outdoor_Demand_Out", self.outport)
        self.addOutPort("Check_Storage", self.currentOutdoorDemand)
        self.addParameter(
            "Watering_Method_(Normal_Watering_or_Smart_Watering)",
            self.watering_method)
        self.addParameter("Smart_Watering_Start_Time_End_Time_[hh,hh]",
                          self.smart_watering_time)
        self.addParameter("Maximal_Watering_Flow_Rate_[l/min]",
                          self.tap_flow_rate)
        self.addParameter("Average_Watering_Frequency_[d]", self.average)
        self.addParameter("Deviation_of_Frequency_[d]", self.deviation)
        self.addParameter("Switch_(On_or_Off)", self.onoff)
        '''
        self.smart_watering_time: 0h not valid, has got to 24 h, start time smaller 24!
        '''
        print '\n' + self.onoff
    def __init__(self):
        #        print "init start hh"
        pycd3.Node.__init__(self)

        self.inport = pycd3.Flow()
        self.outport = pycd3.Flow()
        self.currentOutdoorDemand = pycd3.Flow()
        self.average = pycd3.Double(7)
        self.deviation = pycd3.Double(2)
        self.tap_flow_rate = pycd3.Double(18)
        self.smart_watering_time = pycd3.String("[18,6]")
        self.watering_method = pycd3.String('Smart_Watering')

        self.addInPort("Outdoor_Demand_In", self.inport)
        self.addOutPort("Outdoor_Demand_Out", self.outport)
        self.addOutPort("Check_Storage", self.currentOutdoorDemand)
        self.addParameter(
            "Watering_Method_(Normal_Watering_or_Smart_Watering)",
            self.watering_method)
        self.addParameter("Smart_Watering_Start_Time_End_Time_[hh,hh]",
                          self.smart_watering_time)
        self.addParameter("Maximal_Watering_Flow_Rate_[l/min]",
                          self.tap_flow_rate)
        self.addParameter("Average_Watering_Frequency_[d]", self.average)
        self.addParameter("Deviation_of_Frequency_[d]", self.deviation)
        '''
    def __init__(self):
        pycd3.Node.__init__(self)
        self.inflow = pycd3.String("")
        self.decision = pycd3.String("H")
        self.out = pycd3.Flow()
        
#        print "init node"
        self.addParameter("", self.inflow)
        self.addParameter("Type_H_for_height_[mm]_or_F_for_flow_[l/h]", self.decision)
        self.addOutPort("Outport", self.out)
        
        self.growing_t = 0.0
        self.row_to_get = 0
        self.interp_counter = 0
        self.remember_line = 0.0
        self.decimals = 0.0
        self.rest = 0.0
        self.sum_decimals = 0.0
    def __init__(self):
        pycd3.Node.__init__(self)
        self.inflow = pycd3.String("")
        self.out = pycd3.Flow()

        #        print "init node"
        self.addParameter("", self.inflow)
        self.addOutPort("Outport", self.out)

        self.growing_t = 0.0
        self.row_to_get = 0
        self.interp_counter = 0
        self.remember_line = 0.0
        self.decimals = 0.0
        self.rest = 0.0
        self.sum_decimals = 0.0
    def __init__(self):
        pycd3.Node.__init__(self)
        self.rain = pycd3.Flow()
        self.collected_w = pycd3.Flow()
        self.runoff = pycd3.Flow()
        self.perv_runoff = pycd3.Flow()

        self.imperv_runoff = pycd3.Flow()
        self.evapo = pycd3.Flow()
        self.possible_infiltr = pycd3.Flow()
        self.actual_infiltr = pycd3.Flow()
        self.outdoor_use = pycd3.Flow()
        self.inflow = pycd3.Flow()
        self.outdoor_use_check = pycd3.Flow()

        self.effective_evapotranspiration = pycd3.Flow()
        self.previous_storage = pycd3.Flow()
        self.groundwater_infiltration = pycd3.Flow()


        # self.total_effective_rain / 1000. * self.area_property,
        # self.total_actual_infiltr + self.total_collected_w + self.total_runoff,
        # "infiltration:", self.total_actual_infiltr,
        # "collected:", self.total_collected_w,
        # "outdoor:", self.total_outdoor_use,
        # "runoff:", self.total_runoff,
        # "storage:", self.current_perv_storage_level / self.perv_soil_storage_capacity,
        # "evapo:", self.total_evapotranspiration,
        # "groundwater:", self.total_groundwater
        
        #dir (self.inf)
#        print "init node"
        self.addInPort("Rain", self.rain)
        self.addInPort("Evapotranspiration", self.evapo)
        self.addInPort("Inflow", self.inflow)
        self.addOutPort("Possible_Infiltration", self.possible_infiltr)
        self.addOutPort("Actual_Infiltration", self.actual_infiltr)
        self.addOutPort("Runoff", self.runoff)
        self.addOutPort("Collected_Water", self.collected_w)
        self.addOutPort("Outdoor_Demand", self.outdoor_use)
        self.addOutPort("Outdoor_Demand_Check", self.outdoor_use_check)

        self.addOutPort("effective_evapotranspiration", self.effective_evapotranspiration)
        self.addOutPort("previous_storage", self.previous_storage)
        self.addOutPort("groundwater_infiltration", self.groundwater_infiltration)
        self.addOutPort("pervious_runoff", self.perv_runoff)
        self.addOutPort("impervious_runoff", self.imperv_runoff)

        #Catchment with Routing or without
        self.select_model = pycd3.String("without")
        self.addParameter("Catchment_with_or_without_Routing_(with_or_without)", self.select_model)        
        
        #Catchment area + fraction info of pervious and impervious parts
        self.area_property = pycd3.Double(1000)
        self.addParameter("Catchment_Area_[m^2]", self.area_property)
        self.perv_area = pycd3.Double(0.4)
        self.addParameter("Fraktion_of_Pervious_Area_pA_[-]", self.perv_area)
        self.imp_area_stormwater = pycd3.Double(0.4)
        self.addParameter("Fraktion_of_Impervious_Area_to_Stormwater_Drain_iASD_[-]", self.imp_area_stormwater)
        self.imp_area_raintank = pycd3.Double(0.2)
        self.addParameter("Fraktion_of_Impervious_Area_to_Reservoir_iAR_[-]", self.imp_area_raintank)
        # https://help.innovyze.com/display/xps/Infiltration
        #default values for gras (Wikipedia)
        self.Horton_initial_cap = pycd3.Double(0.09)
        self.addParameter("Initial_Infiltration_Capacity_[m/h]", self.Horton_initial_cap)
        self.Horton_final_cap = pycd3.Double(0.001)
        self.addParameter("Final_Infiltration_Capacity_[m/h]", self.Horton_final_cap)
        self.Horton_decay_constant = pycd3.Double(0.06)
        self.addParameter("Decay_Constant_[1/min]", self.Horton_decay_constant)

        # Storage in m
        self.perv_soil_storage_capacity = pycd3.Double(0.030)
        self.addParameter("Soil Storage Capacity in m", self.perv_soil_storage_capacity)

        self.daily_recharge_rate = pycd3.Double(0.25) # in %
        self.addParameter("Daily Recharge Rate", self.daily_recharge_rate)

        # E-Water https://wiki.ewater.org.au/display/MD6/Appendix+A%3A+Rainfall-Runoff+Modelling
        self.transpiration_capacity = pycd3.Double(0.007)
        self.addParameter("Transpire Capacity", self.transpiration_capacity)

        #default values for suburbs (scrip Prof. Krebs)
        self.depression_loss = pycd3.Double(0.0015)
        self.addParameter("Depression_Loss_[m]", self.depression_loss)
        
        #default values for (scrip Prof. Krebs)
        self.initial_loss = pycd3.Double(0.004)
        self.addParameter("Wetting_Loss_[m]", self.initial_loss)
        
        #number of subareas for flowconcentration
        self.amount_subareas = pycd3.Double(1)
        self.addParameter("Number_of_Subareas_[-]", self.amount_subareas)
        
        #factor for calibrating outdoordemand
        self.outdoor_demand_coefficient = pycd3.Double(0.5)
        self.addParameter("Outdoor_Demand_Weighing_Factor_[-]", self.outdoor_demand_coefficient)
        
        #Muskingum parameters K flowtime for entire catchment
        #divided by surface Area
        self.rain_runtime_coll = pycd3.Double(400)
        self.addParameter("Runoff_Runtime_iAR_[s]", self.rain_runtime_coll)
        self.muskingum_coll_X = pycd3.Double(0.04)
        self.addParameter("Weighting_Coefficient_iAR_[-]", self.muskingum_coll_X)
        self.rain_runtime_runoff = pycd3.Double(500)
        self.addParameter("Runoff_Runtime_iASD_[s]", self.rain_runtime_runoff)
        self.muskingum_runoff_X = pycd3.Double(0.05)
        self.addParameter("Weighting_Coefficient_iASD_[-]", self.muskingum_runoff_X)
        self.rain_runtime_runoff_perv = pycd3.Double(700)
        self.addParameter("Runoff_Runtime_pA_[s]", self.rain_runtime_runoff_perv)
        self.muskingum_runoff_perv_X = pycd3.Double(0.06)
        self.addParameter("Weighting_Coefficient_pA_[-]", self.muskingum_runoff_perv_X)
        
        #storage and time values
        self.current_effective_rain_height = 0.0
        self.rain_storage_imp = 0.0
        self.continuous_rain_time = 0.0
        self.continuous_rain_time_2 = 0.0                                        
        self.rain_storage_perv = 0.0
        self.rain_storage_imp_before = 0.0

        
        #variable to check Horten model (has got to be 1 for a real simulation)
        self.k=1
        
        #storage for Muskingum inflows
        self.collected_w_raw = 0.0
        self.runoff_raw = 0.0
        self.runoff_perv_raw=0.0
    def __init__(self):
        pycd3.Node.__init__(self)
        self.rain = pycd3.Flow()
        self.collected_w = pycd3.Flow()
        self.runoff = pycd3.Flow()
        self.evapo = pycd3.Flow()
        self.possible_infiltr = pycd3.Flow()
        self.actual_infiltr = pycd3.Flow()
        self.outdoor_use = pycd3.Flow()
        self.inflow = pycd3.Flow()
        self.outdoor_use_check = pycd3.Flow()
        
        #dir (self.inf)
#        print "init node"
        self.addInPort("Rain", self.rain)
        self.addInPort("Evapotranspiration", self.evapo)
        self.addInPort("Inflow", self.inflow)
        self.addOutPort("Possible_Infiltration", self.possible_infiltr)
        self.addOutPort("Actual_Infiltration", self.actual_infiltr)
        self.addOutPort("Runoff", self.runoff)
        self.addOutPort("Collected_Water", self.collected_w)
        self.addOutPort("Outdoor_Demand", self.outdoor_use)
        self.addOutPort("Outdoor_Demand_Check", self.outdoor_use_check)
        
        #Catchment with Routing or without
        self.select_model = pycd3.String("without")
        self.addParameter("Catchment_with_or_without_Routing_(with_or_without)", self.select_model)        
        
        #Catchment area + fraction info of pervious and impervious parts
        self.area_property = pycd3.Double(1000)
        self.addParameter("Catchment_Area_[m^2]", self.area_property)
        self.perv_area = pycd3.Double(0.4)
        self.addParameter("Fraktion_of_Pervious_Area_pA_[-]", self.perv_area)
        self.imp_area_stormwater = pycd3.Double(0.4)
        self.addParameter("Fraktion_of_Impervious_Area_to_Stormwater_Drain_iASD_[-]", self.imp_area_stormwater)
        self.imp_area_raintank = pycd3.Double(0.2)
        self.addParameter("Fraktion_of_Impervious_Area_to_Reservoir_iAR_[-]", self.imp_area_raintank)
        
        #default values for gras (Wikipedia)
        self.Horton_initial_cap = pycd3.Double(0.9)                             
        self.addParameter("Initial_Infiltration_Capacity_[m/h]", self.Horton_initial_cap)
        self.Horton_final_cap = pycd3.Double(0.29)                              
        self.addParameter("Final_Infiltration_Capacity_[m/h]", self.Horton_final_cap)
        self.Horton_decay_constant = pycd3.Double(2.0)                          
        self.addParameter("Decay_Constant_[1/min]", self.Horton_decay_constant)
        
        #default values for suburbs (scrip Prof. Krebs)
        self.depression_loss = pycd3.Double(1.5)                                
        self.addParameter("Depression_Loss_[mm]", self.depression_loss)
        
        #default values for (scrip Prof. Krebs)
        self.initial_loss = pycd3.Double(0.4)                                   
        self.addParameter("Wetting_Loss_[mm]", self.initial_loss)
        
        #number of subareas for flowconcentration
        self.amount_subareas = pycd3.Double(1)
        self.addParameter("Number_of_Subareas_[-]", self.amount_subareas)
        
        #factor for calibrating outdoordemand
        self.outdoor_demand_coefficient = pycd3.Double(0.5)
        self.addParameter("Outdoor_Demand_Weighing_Factor_[-]", self.outdoor_demand_coefficient)
        
        #Muskingum parameters K flowtime for entire catchment
        #divided by surface Area
        self.rain_runtime_coll = pycd3.Double(400)
        self.addParameter("Runoff_Runtime_iAR_[s]", self.rain_runtime_coll)
        self.muskingum_coll_X = pycd3.Double(0.04)
        self.addParameter("Weighting_Coefficient_iAR_[-]", self.muskingum_coll_X)
        self.rain_runtime_runoff = pycd3.Double(500)
        self.addParameter("Runoff_Runtime_iASD_[s]", self.rain_runtime_runoff)
        self.muskingum_runoff_X = pycd3.Double(0.05)
        self.addParameter("Weighting_Coefficient_iASD_[-]", self.muskingum_runoff_X)
        self.rain_runtime_runoff_perv = pycd3.Double(700)
        self.addParameter("Runoff_Runtime_pA_[s]", self.rain_runtime_runoff_perv)
        self.muskingum_runoff_perv_X = pycd3.Double(0.06)
        self.addParameter("Weighting_Coefficient_pA_[-]", self.muskingum_runoff_perv_X)
        
        #storage and time values
        self.current_effective_rain_height = 0.0
        self.rain_storage_imp = 0.0
        self.continuous_rain_time = 0.0
        self.continuous_rain_time_2 = 0.0                                        
        self.rain_storage_perv = 0.0
        self.rain_storage_imp_before = 0.0
        
        #variable to check Horten model (has got to be 1 for a real simulation)
        self.k=1
        
        #storage for Muskingum inflows
        self.collected_w_raw = 0.0
        self.runoff_raw = 0.0
        self.runoff_perv_raw=0.0
    def __init__(self):
        pycd3.Node.__init__(self)
        self.rain = pycd3.Flow()
        self.collected_w = pycd3.Flow()
        self.runoff = pycd3.Flow()
        self.evapo = pycd3.Flow()
        self.possible_infiltr = pycd3.Flow()
        self.actual_infiltr = pycd3.Flow()
        #        self.outdoor_use = pycd3.Flow()
        self.inflow = pycd3.Flow()
        self.gardensize = pycd3.Flow()

        #dir (self.inf)
        #        print "init node"
        self.addInPort("Rain", self.rain)
        self.addInPort("Evapotranspiration", self.evapo)
        self.addInPort("Inflow", self.inflow)
        self.addOutPort("Possible_Infiltration", self.possible_infiltr)
        self.addOutPort("Infiltration", self.actual_infiltr)
        self.addOutPort("Runoff", self.runoff)
        self.addOutPort("Collected_Water", self.collected_w)
        self.addOutPort("Gardensize", self.gardensize)
        #        self.addOutPort("Outdoor_Demand_Check", self.outdoor_use_check)

        #Catchment with Routing or without
        self.select_model = pycd3.String("without")
        self.addParameter(
            "Catchment_with_or_without_Routing_(with_or_without)",
            self.select_model)

        self.dryrate = pycd3.Double(1)
        self.addParameter("Drying_Factor_[-]", self.dryrate)

        #Catchment area + fraction info of pervious and impervious parts
        self.area_property = pycd3.Double(1000)
        self.addParameter("Catchment_Area_[m^2]", self.area_property)
        self.perv_area = pycd3.Double(0.4)
        self.addParameter("Fraktion_of_Pervious_Area_pA_[-]", self.perv_area)
        self.imp_area_stormwater = pycd3.Double(0.4)
        self.addParameter(
            "Fraktion_of_Impervious_Area_to_Stormwater_Drain_iASD_[-]",
            self.imp_area_stormwater)
        self.imp_area_raintank = pycd3.Double(0.2)
        self.addParameter("Fraktion_of_Impervious_Area_to_Reservoir_iAR_[-]",
                          self.imp_area_raintank)

        #default values for gras (Wikipedia)
        self.Horton_initial_cap = pycd3.Double(0.9)
        self.addParameter("Initial_Infiltration_Capacity_[m/h]",
                          self.Horton_initial_cap)
        self.Horton_final_cap = pycd3.Double(0.29)
        self.addParameter("Final_Infiltration_Capacity_[m/h]",
                          self.Horton_final_cap)
        self.Horton_decay_constant = pycd3.Double(2.0)
        self.addParameter("Decay_Constant_[1/min]", self.Horton_decay_constant)

        #default values for suburbs (scrip Prof. Krebs)
        self.depression_loss = pycd3.Double(1.5)
        self.addParameter("Depression_Loss_[mm]", self.depression_loss)

        #default values for (scrip Prof. Krebs)
        self.wetting_loss = pycd3.Double(0.4)
        self.addParameter("Wetting_Loss_[mm]", self.wetting_loss)

        #factor for calibrating outdoordemand
        #        self.outdoor_demand_coefficient = pycd3.Double(0.5)
        #        self.addParameter("Outdoor_Demand_Weighing_Factor_[-]", self.outdoor_demand_coefficient)

        #linear storage coefficients for each surface type
        self.linearstorage_perv_K = pycd3.Double(1000)
        self.addParameter("Linear_Storage_Factor_Pervious_Area_K_[s]",
                          self.linearstorage_perv_K)
        self.linearstorage_imperv_res_K = pycd3.Double(1000)
        self.addParameter(
            "Linear_Storage_Factor_Impervious_Area_to_Reservoir_K_[s]",
            self.linearstorage_imperv_res_K)
        self.linearstorage_imperv_storm_K = pycd3.Double(1000)
        self.addParameter(
            "Linear_Storage_Factor_Impervious_Area_to_Stormwater_Drain_K_[s]",
            self.linearstorage_imperv_storm_K)

        #storage and time values
        self.rainmemory = 0.0
        self.rain_storage_imp = 0.0
        self.continuous_rain_time = 0.0
        self.continuous_rain_time_2 = 0.0
        self.rain_storage = 0.0
        self.rainstoragemen = 0.0
        #variable to check Horten model
        self.k = 1

        #storage for linear storage model
        self.collected_w_raw = 0.0
        self.runoff_raw = 0.0
        self.runoff_perv_raw = 0.0