Running wholesale market separately

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running wholesale market separately

Porag
Hi John,

I would like to run some experiments to test various bidding strategies in the wholesale market only. So I was wondering if it is possible to run the Powertac wholesale market separately? If not what will be your suggestion for me to make such a wholesale market simulator?

Thanks
Porag
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running wholesale market separately

grampajohn
Administrator
Hello, Porag -

Porag wrote
Hi John,

I would like to run some experiments to test various bidding strategies in the wholesale market only. So I was wondering if it is possible to run the Powertac wholesale market separately? If not what will be your suggestion for me to make such a wholesale market simulator?
The wholesale market simulator is contained in the auctioneer module. You can look at the junit test cases in auctioneer to see some examples of exercising it in isolation. You have to either depend on or mock elements of the accounting module to see the results.

Does this help?

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running wholesale market separately

Porag
Hello John,

Thank you very much. Yes it helped a lot.

I have also downloaded the server code from the github and checked out all the modules. But I wasn't able to run it. Can you please give me directions i.e. how to run the server from its code?

Best regards,
Porag
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running wholesale market separately

grampajohn
Administrator
Hello, Porag -
Porag wrote
Can you please give me directions i.e. how to run the server from its code?
Detailed instructions for working with server source are on the github wiki. If you don't need to plow through the source and just want to run from source, it should be enough to just build the powertac-server modules (cd powertac-server; mvn clean install) and run from server-distribution.

Does this help?

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running wholesale market separately

Porag
Thank you very much John. Yes it helped a lot. I was able to run the server code from STS.

John, I want to create a separate wholesale simulator using the powertac wholesale api calls. The JUnit AuctioneerServiceTest.java helped me to understand how the Auctioneer api works. But I am confused at one place i.e. creating mock objects. e.g.

// mock the AccountingService, capture args
    doAnswer(new Answer()
    {
      @Override
      public Object answer (InvocationOnMock invocation)
      {
        Object[] args = invocation.getArguments();
        accountingArgs.add(args);
        return null;
      }
    }).when(accountingService).addMarketTransaction(isA(Broker.class),
        isA(Timeslot.class),
        anyDouble(),
        anyDouble());
   

How can I create this without the JUnit test cases. Can you please give me an example? Or should I write my simulator as a JUnit test case? Which will be easier?

Thanks and best regards
Porag
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running wholesale market separately

grampajohn
Administrator
Hello, Porag and all -
Porag wrote
I want to create a separate wholesale simulator using the powertac wholesale api calls. The JUnit AuctioneerServiceTest.java helped me to understand how the Auctioneer api works. But I am confused at one place i.e. creating mock objects. e.g.

...

How can I create this without the JUnit test cases. Can you please give me an example? Or should I write my simulator as a JUnit test case? Which will be easier?
You could implement your own version of Accounting, or just modify AccountingService to process transactions from the market however you see fit. To see how to make a runnable app, take a look at server-main/pom.xml. That's where you specify the set of modules that will run when you start it with the cli. Just include the modules you want, set up the config the way you want it, and start it up. You can probably get all the market interaction you need by or replacing one or more of the genco classes, and of course you can hook up brokers. The broker login process is encapsulated in the server-main module.

Make sense?

John
Loading...