Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with using ArrayBid for BidUpdate #213

Open
jhaprakash opened this issue Oct 10, 2016 · 0 comments
Open

Trouble with using ArrayBid for BidUpdate #213

jhaprakash opened this issue Oct 10, 2016 · 0 comments

Comments

@jhaprakash
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant