def __init__(self, scenario_values=None, costcurveequation='0', fuelcost=1, bid_points=None, noloadcost=0, mustrun=False, faststart=False, pmin=0, pmax=None, name='', index=None, bus=None, kind='wind', observed_values=None, schedule=None, sheddingallowed=False, **kwargs): update_attributes(self, locals()) # load in inputs self.is_controllable = False self.is_stochastic = not \ (user_config.perfect_solve or user_config.deterministic_solve) self.build_cost_model() self.init_optimization() self.startupcost = 0 self.shutdowncost = 0 self.fuelcost = float(fuelcost) self.shedding_mode = sheddingallowed and user_config.economic_wind_shed
def __init__(self, power_system, times, datadir='.', is_stochastic=False): update_attributes(self, locals()) self._resolved = False self._setup_powersystem() self._get_problem_info() self._get_outputs() self._get_costs() self._get_prices()
def __init__(self, *args, **kwargs): ''' Individual class defined. Initialize the object. Often this just means assigning all of the keyword arguments to self. The :meth:`~OptimizationObject.init_optimization` method should be called in __init__. ''' update_attributes(self, locals()) # load in inputs self.init_optimization()
def __init__(self, name='', index=None, bus=None, schedule=None, sheddingallowed=True, cost_shedding=None, ): update_attributes(self, locals()) # load in inputs if cost_shedding is None: self.cost_shedding = user_config.cost_load_shedding self.init_optimization() self.shedding_mode = False
def __init__(self, name='', index=None, frombus=None, tobus=None, reactance=0.05, pmin=None, pmax=9999, **kwargs): update_attributes(self, locals()) # load in inputs if self.pmin is None: self.pmin = -1 * self.pmax # default is -1*pmax self.init_optimization()
def __init__(self, kind='generic', pmin=0, pmax=500, minuptime=0, mindowntime=0, rampratemax=None, rampratemin=None, costcurveequation='20P', heatrateequation=None, fuelcost=1, bid_points=None, noloadcost=0, startupcost=0, shutdowncost=0, startupramplimit=None, shutdownramplimit=None, faststart=False, mustrun=False, name='', index=None, bus=None): update_attributes(self, locals()) # load in inputs # The formulation below requires that startup ramp limits are set. # The defaults are the normal ramp rate limits, # unless Pmin so high and Rmin/max small that startup is infeasible. # In that case the default is Pmin. if (self.startupramplimit is None) and (self.rampratemax is not None): if self.pmin > self.rampratemax: self.startupramplimit = self.pmin else: self.startupramplimit = self.rampratemax if (self.shutdownramplimit is None) and (self.rampratemin is not None): if (-1 * self.pmin < self.rampratemin): self.shutdownramplimit = -1 * self.pmin else: self.shutdownramplimit = self.rampratemin self.fuelcost = float(fuelcost) self.is_controllable = True self.is_stochastic = False self.commitment_problem = True self.build_cost_model() self.init_optimization()
def __init__(self, generators, loads, lines=None): # load in inputs update_attributes(self, locals(), exclude=["generators", "loads", "lines"]) self.reserve_fixed = user_config.reserve_fixed self.reserve_load_fraction = user_config.reserve_load_fraction self.reserve_required = (self.reserve_fixed > 0) or (self.reserve_load_fraction > 0.0) if lines is None: # pragma: no cover lines = [] buses = self.make_buses_list(loads, generators) self.create_admittance_matrix(buses, lines) self.init_optimization() self.add_children(buses, "buses") self.add_children(lines, "lines") self.is_stochastic = len(filter(lambda gen: gen.is_stochastic, generators)) > 0 self.shedding_mode = False
def __init__(self, power_system, times, datadir='.', is_stochastic=True): update_attributes(self, locals()) self._setup_powersystem() self.scenarios = sorted(self.power_system._scenario_instances.keys()) self.stage_start = times.strings.index[0] gen = self.power_system.get_generator_with_scenarios() try: # single stage setup self.probability = gen.scenario_values.probability.dropna() except AttributeError: # staged setup self.probability = gen._get_scenario_probabilities(times) self.probability.index = self.scenarios self._get_problem_info() self._get_outputs() self._get_costs() self._get_prices()
def __init__(self, power_system, stage_times, stage_solutions): update_attributes(self, locals(), exclude=['stage_solutions', 'stage_times']) self._resolved = power_system.is_stochastic \ or user_config.deterministic_solve or user_config.perfect_solve self.is_stochastic = any(sln.is_stochastic for sln in stage_solutions) times = pd.concat( [times.non_overlap().strings for times in stage_times]).index self.times = TimeIndex(times) self.times.set_initial(stage_times[0].initialTime) self.objective = self._sum_over('objective', stage_solutions) self.solve_time = self._sum_over('solve_time', stage_solutions) self.mipgaps = pd.Series([sln.mipgap for sln in stage_solutions]) self._get_outputs(stage_solutions) self._get_costs(stage_solutions) self._get_prices(stage_solutions)
def __init__(self, polynomial='10P', bid_points=None, constant_term=0, owner=None, times=None, input_variable=0, min_input=0, max_input=1000, num_breakpoints=user_config.breakpoints, status_variable=True, fixed_input=False): update_attributes(self, locals(), exclude=['owner']) self._parent_problem = owner._parent_problem self.owner_id = str(owner) self.is_pwl = (self.bid_points is not None) self.is_linear = is_linear(self.polynomial) if not fixed_input: self.build_model()
def __init__(self, generators, loads, lines=None): # load in inputs update_attributes(self, locals(), exclude=['generators', 'loads', 'lines']) self.reserve_fixed = user_config.reserve_fixed self.reserve_load_fraction = user_config.reserve_load_fraction self.reserve_required = (self.reserve_fixed > 0) or \ (self.reserve_load_fraction > 0.0) if lines is None: # pragma: no cover lines = [] buses = self.make_buses_list(loads, generators) self.create_admittance_matrix(buses, lines) self.init_optimization() self.add_children(buses, 'buses') self.add_children(lines, 'lines') self.is_stochastic = len( filter(lambda gen: gen.is_stochastic, generators)) > 0 self.shedding_mode = False
def __init__(self, schedule=None, fuelcost=1, costcurveequation='0', bid_points=None, noloadcost=0, mustrun=False, faststart=False, sheddingallowed=False, pmin=0, pmax=None, name='', index=None, bus=None, kind='wind', observed_values=None, **kwargs): update_attributes(self, locals()) # load in inputs self.is_controllable = False self.startupcost = 0 self.shutdowncost = 0 self.fuelcost = float(fuelcost) self.build_cost_model() self.init_optimization() self.is_stochastic = False self.shedding_mode = sheddingallowed and user_config.economic_wind_shed
def __init__(self, name=None, index=None, isSwing=False): update_attributes(self, locals()) # load in inputs self.generators, self.loads = [], [] self.init_optimization()