Query on how to get duration of the game

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

Query on how to get duration of the game

easwar1977
Dear all,

  Is there a way to get the duration of a game ? For example if a game has only 1764 timeslots, can I know that information when the game starts ? If so, how ?

  I believe there is a SIM-END message. But I am not sure where to capture it. But I am more interested in knowing the duration of a game in terms of number of timeslots. I believe this is a game parameter that can be procured somewhere.

Easwar
Reply | Threaded
Open this post in threaded view
|

Re: Query on how to get duration of the game

grampajohn
Administrator
Hello, Easwar -
easwar1977 wrote
Is there a way to get the duration of a game ? For example if a game has only 1764 timeslots, can I know that information when the game starts ? If so, how ?

I believe there is a SIM-END message. But I am not sure where to capture it. But I am more interested in knowing the duration of a game in terms of number of timeslots. I believe this is a game parameter that can be procured somewhere.
Brokers are not supposed to be able to predict the exact end of a game, because there are several unrealistic ways a broker might exploit that information. But the Competition object contains the earliest end and the expected end. The game specification explains the distribution. Also see Issue #963, which should be fixed in the next week or so.

Does this help?

John
Reply | Threaded
Open this post in threaded view
|

Re: Query on how to get duration of the game

susobhang70
Hi John,

The GitHub issue you linked will certainly help when it's resolved.

However, in the meantime, is there any way that we can probably catch or handle the Sim-end message?

Thanks
Susobhan
Reply | Threaded
Open this post in threaded view
|

Re: Query on how to get duration of the game

grampajohn
Administrator
susobhang70 wrote
The GitHub issue you linked will certainly help when it's resolved.

However, in the meantime, is there any way that we can probably catch or handle the Sim-end message?
You can handle any incoming message you like with a handleMessage() method. When I add this

  
  public void handleMessage (SimEnd se)
  {
    System.out.println ("SimEnd");
  }

to the ContextManager in the sample broker, it indeed prints "SimEnd" at the end of the game.

Is this what you were looking for?

John
Reply | Threaded
Open this post in threaded view
|

Re: Query on how to get duration of the game

easwar1977
Thanks John for the reply. It does help us.

Easwar
Reply | Threaded
Open this post in threaded view
|

Re: Query on how to get duration of the game

grampajohn
Administrator
A little clarification is in order, I think. I had forgotten that the game-duration data is not sent to brokers at all, and it was already possible to fix the duration of a game by setting
common.competition.minimumTimeslotCount
 and
common.competition.expectedTimeslotCount
 to the same value. The only thing we did in #963 was to add another config parameter
common.competition.fixedTimeslotCount
 that allows you to set a fixed game length with a single config var. The fix is pushed to github, it involves both powertac-common and powertac-server, but it is not yet deployed. I'm in Europe at the moment, and I'm having trouble deploying from my laptop. If I don't figure it out in the next day or so, I'll do a fresh deploy once I home in Wisconsin on Tuesday. We are hoping to be ready for a full release within about 2 weeks; until then you will have to use 1.5.0-SNAPSHOT.

Cheers -

John