Returns the generator reactive power variable set.
60
def _get_qgen_var(self, generators, base_mva):
        
        Qg = array([g.q / base_mva for g in generators])

        Qmin = array([g.q_min / base_mva for g in generators])
        Qmax = array([g.q_max / base_mva for g in generators])

        return Variable("Qg", len(generators), Qg, Qmin, Qmax)
588734
def generators(self):
        
        if not self._generators:
            generators = list(self.graph.nodes_by_attribute('generator'))
            generators.extend(list(self.graph.nodes_by_attribute(
                'generator_aggr')))
            return generators
        else:
            return self._generators
485333
public ArrayList<String> getGenerators() {
        ArrayList<String> genList = new ArrayList<String>();
        for (ArrayList<HashMap<String, String>> genGroup : genGroups) {
            if (!genGroup.isEmpty()) {
                HashMap<String, String> genRule = genGroup.get(genGroup.size() - 1);
                if (!genRule.isEmpty()) {
                    genList.add(genRule.get("cmd") + "," + genRule.get("variable") + "," + genRule.get("args"));
                }
            }
        }

        return genList;
    }
94063
def get_energy(self):
        
        value = self.box.homeautoswitch("getswitchenergy", self.actor_id)
        return int(value) if value.isdigit() else None
1287380
private static int[][] getPowerSet(int[] set) {
        int[][] sets = new int[getPowerSetSize(set.length)][];
        getPowerSet(set, 0, null, sets, 0);
        return sets;
    }
1373422
def set_of(*generators):
    

    class SetOfGenerators(ArbitraryInterface):
        """
        A closure class around the generators specified above, which
        generates a set of the generators.
        """

        @classmethod
        def arbitrary(cls):
            """
            Generate a set of the enclosed generators.
            """
            arbitrary_set = set()
            for generator in generators:
                arbitrary_set |= {
                    arbitrary(generator)
                    # max_size / len(generators):
                    for _ in range(arbitrary(int) % 100)
                }
            return arbitrary_set

    SetOfGenerators.__name__ = ''.join([
        'set_of(', ', '.join(generator.__name__ for generator in generators),
        ')'
    ])
    return SetOfGenerators
90829
def _get_voltage_magnitude_var(self, buses, generators):
        
        Vm = array([b.v_magnitude for b in buses])

        # For buses with generators initialise Vm from gen data.
        for g in generators:
            Vm[g.bus._i] = g.v_magnitude

        Vmin = array([b.v_min for b in buses])
        Vmax = array([b.v_max for b in buses])

        return Variable("Vm", len(buses), Vm, Vmin, Vmax)
401564
public ITestCaseGenerator getGenerator( String functionName)
    {
    ITestCaseGenerator generator = generators_.get( getFunctionKey( functionName));
    return generator==null? generators_.get( ALL) : generator;
    }
362667
def power(self):
        """"""
        power = self._state['powerUsage']
        return PowerUsage(power.get('avgDayValue'),
                          power.get('avgValue'),
                          power.get('dayCost'),
                          power.get('dayUsage'),
                          power.get('isSmart'),
                          power.get('meterReading'),
                          power.get('value'),
                          power.get('meterReadingLow'),
                          power.get('dayLowUsage'))
1133426
def get_installed_power(self):
        

        """
        for wind_farm in self.wind_farms:
            wind_farm.installed_power = wind_farm.get_installed_power()
        return sum(wind_farm.installed_power for wind_farm in self.wind_farms)
1085824
public String getVariableSetterType() {
        final String prefix = List.class.getName();
        if (variableType.startsWith(prefix)) {
            return Collection.class.getName() + variableType.substring(prefix.length());
        } else {
            return variableType;
        }
    }
690113
def getChargingCurrent(self):
    """"""
    command = '$GG'
    currentAndVoltage = self.sendCommand(command)
    amps = float(currentAndVoltage[1])/1000
    return amps
472723
def alternator(*pipes):
    '''  '''
    try:
        for p in cycle(map(iter, pipes)):
            yield next(p)
    except StopIteration:
        pass
775158
def generator(self, t):
        """"""
        self.check_fit()

        return (1.0 / self.theta) * (np.power(t, -self.theta) - 1)
209898
def generator(self,gen,*args,**kwargs):
        
        with self(*args,**kwargs):
            for i in gen:
                yield i
550931
def get_power(self):
        """"""
        self.get_status()
        try:
            self.consumption = self.data['power']
        except TypeError:
            self.consumption = 0

        return self.consumption
175649
def _power_mismatch_dc(self, buses, generators, B, Pbusinj, base_mva):
        
        nb, ng = len(buses), len(generators)
        # Negative bus-generator incidence matrix.
        gen_bus = array([g.bus._i for g in generators])
        neg_Cg = csr_matrix((-ones(ng), (gen_bus, range(ng))), (nb, ng))

        Amis = hstack([B, neg_Cg], format="csr")

        Pd = array([bus.p_demand for bus in buses])
        Gs = array([bus.g_shunt for bus in buses])

        bmis = -(Pd - Gs) / base_mva - Pbusinj

        return LinearConstraint("Pmis", Amis, bmis, bmis, ["Va", "Pg"])