Demo entry 6746401

430503199701011528

   

Submitted by anonymous on May 30, 2018 at 04:26
Language: Java. Code size: 783 Bytes.

public void createTestCase() {
	int i = 0;
	double dp = 0;
	for (AclfBus bus : getAclfNet().getBusList()) {
		if (bus.isActive()) {
			if ( this.busId2NoMapping != null )
				i = this.busId2NoMapping.get(bus.getId());				
			if (!bus.isSwing() && !bus.isGenPV()) { 
				double factor= 2*new Random().nextFloat();
				bus.setLoadP(this.baseCaseData[i].loadP * factor);
				bus.setLoadQ(this.baseCaseData[i].loadQ * factor * (0.8 + 0.4 * new Random().nextFloat()));
				dp +=bus.getLoadP()-this.baseCaseData[i].loadP;
			}
			i++;
		}
	}
	AclfBus bus = getAclfNet().getBus("Bus2");
	bus.setGenP(dp*new Random().nextFloat()); //bus.setGenP(dp + bus.getGenP * new Random().nextFloat());
	String result = this.runLF(this.getAclfNet());
	System.out.println(result);
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).