-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hi,
I followed Powermatcher tutorial and wrote a PVPanelAgent in the examples package. In the doBidUpdate, when I use Bid.flatDemand to publish the bit, I can see the bids going to concentrator and to auctioneer.
I tried to send ArrayBid and it doesn't work. Following is the code snippet for the same. All help will be appreciated. Thanks in advance.
1st variant
`void doBidUpdate() {
AgentEndpoint.Status currentStatus = getStatus();
if (currentStatus.isConnected()) {
ArrayBid.Builder builder = new ArrayBid.Builder(currentStatus.getMarketBasis());
double[] bidCurve = new double[currentStatus.getMarketBasis().getPriceSteps()];
bidCurve[0] = -3.0E2;
bidCurve[1] = -2.50E2;
bidCurve[2] = -3.00E2;
bidCurve[3] = -1.50E2;
bidCurve[4] = -2.00E2;
bidCurve[5] = -2.75E2;
bidCurve[6] = -3.00E2;
bidCurve[7] = -3.00E2;
bidCurve[8] = -3.00E2;
bidCurve[9] = -3.00E2;
publishBid(builder.demandArray(bidCurve).build());
}
}`
2nd variant
`void doBidUpdate() {
AgentEndpoint.Status currentStatus = getStatus();
if (currentStatus.isConnected()) {
ArrayBid.Builder builder = new ArrayBid.Builder(currentStatus.getMarketBasis()); builder.demand(-300).demand(-250).demand(-300).demand(-150).demand(-200).demand(-275).demand(-300);
publishBid(builder.build());
}
}`
3rd Variant
void doBidUpdate() { AgentEndpoint.Status currentStatus = getStatus(); if (currentStatus.isConnected()) { publishBid((new ArrayBid.Builder(currentStatus.getMarketBasis()).demand(-300)).build()); } }
now, 3rd variant is same as flatDemand and it does work for couple of bids and then it stops working. Am I missing something?