TariffTransactions

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

TariffTransactions

HarryRose
We can see in the logs that our agent is receiving the xml for a tariff transaction (<tariff-tx> ...).  However, it never seems to be parsed into an object and then passed to our components as a message.

In getMessages() in CompetitionManagementService.groovy we have

 def getMessages () {
    [Competition, SimStart, TimeslotUpdate, SimEnd, SimPause, SimResume,MarketTransaction,  CustomerBootstrapData, TariffSpecification,TariffTransaction]
  }

We are receiving other messages such as TariffSpeficication and TimeslotUpdate etc as expected.  We're using code from the master branch of your git repo.

Is this a known issue?  Do you have any suggestions as to how to fix it?
Reply | Threaded
Open this post in threaded view
|

Re: TariffTransactions

HarryRose
I think the problem could be to do with parsing the list received.

xstream attempts to convert the xml

<list>
  <tariff-tx id="7" txType="SIGNUP" customerCount="8" quantity="0.0" charge="0.0">
    <broker>grailsDemo</broker>
    <customerInfo>7d74d1a3-92c0-4ed6-ba8e-698611d84204</customerInfo>
    <postedTime>
      <iMillis>1277078400000</iMillis>
    </postedTime>
    <tariffSpec>085f2230-e84c-49f9-bb54-6df7d01f484b</tariffSpec>
  </tariff-tx>
  <tariff-tx id="5" txType="PUBLISH" customerCount="0" quantity="0.0" charge="-100.0">
    <broker reference="../../tariff-tx/broker"/>
    <postedTime reference="../../tariff-tx/postedTime"/>
    <tariffSpec reference="../../tariff-tx/tariffSpec"/>
  </tariff-tx>
  <tariff-tx id="6" txType="SIGNUP" customerCount="8" quantity="0.0" charge="0.0">
    <broker reference="../../tariff-tx/broker"/>
    <customerInfo>abd94abc-5057-4b80-886d-cff073f51ab6</customerInfo>
    <postedTime reference="../../tariff-tx/postedTime"/>
    <tariffSpec reference="../../tariff-tx/tariffSpec"/>
  </tariff-tx>
  <cash balance="-100.0318">
    <broker reference="../../tariff-tx/broker"/>
    <id>2</id>
  </cash>
  <bank-tx amount="-0.03179529054646162">
    <broker reference="../../tariff-tx/broker"/>
    <postedTime reference="../../tariff-tx/postedTime"/>
  </bank-tx>
  <distribution-tx id="1" quantity="0.0000" charge="0.0000">
    <broker reference="../../tariff-tx/broker"/>
    <postedTime reference="../../tariff-tx/postedTime"/>
  </distribution-tx>
</list>

but does not return any object (presumably meaning it failed to parse the XML).

Reply | Threaded
Open this post in threaded view
|

Re: TariffTransactions

grampajohn
Administrator
I'm running the demo broker. I submitted a tariff (you will not get any tariff transactions unless you first submit a tariff), and I see log entries like:

2011-07-13 09:17:18,509 [DefaultMessageListenerContainer-1] DEBUG messaging.MessageListenerRegistrar  - getAssignableRegistrations(class org.powertac.common.TariffTransaction) - start
2011-07-13 09:17:18,510 [DefaultMessageListenerContainer-1] DEBUG messaging.MessageListenerRegistrar  - getAssignableRegistrations(class org.powertac.common.TariffTransaction) - end [org.powertac.broker.infrastructure.messaging.MarketMessageListener@1c55a79]
2011-07-13 09:17:18,510 [DefaultMessageListenerContainer-1] DEBUG messaging.MarketMessageListener  - onMessage(org.powertac.common.TariffTransaction) - start
2011-07-13 09:17:18,510 [DefaultMessageListenerContainer-1] DEBUG messaging.MarketMessageListener  - onMessage(org.powertac.common.TariffTransaction) - saving...
2011-07-13 09:17:18,518 [DefaultMessageListenerContainer-1] DEBUG persistence.MessagePersistenceManager  - save(TariffTransaction) - start
2011-07-13 09:17:18,531 [DefaultMessageListenerContainer-1] DEBUG persistence.MessagePersistenceManager  - save(TariffTransaction) - receving SIGNUP ttx for grailsDemo
2011-07-13 09:17:18,531 [DefaultMessageListenerContainer-1] DEBUG persistence.MessagePersistenceManager  - save(TariffTransaction) - end
2011-07-13 09:17:18,532 [DefaultMessageListenerContainer-1] DEBUG messaging.MarketMessageListener  - onMessage(org.powertac.common.TariffTransaction) - end
2011-07-13 09:17:18,532 [DefaultMessageListenerContainer-1] DEBUG messaging.MessageListenerRegistrar  - getAssignableRegistrations(class org.powertac.common.TariffTransaction) - start
2011-07-13 09:17:18,532 [DefaultMessageListenerContainer-1] DEBUG messaging.MessageListenerRegistrar  - getAssignableRegistrations(class org.powertac.common.TariffTransaction) - end [org.powertac.broker.infrastructure.messaging.MarketMessageListener@1c55a79]

... etc.

This happens when the incoming list is pulled apart into its components. Are you not seeing this?

John
Reply | Threaded
Open this post in threaded view
|

Re: TariffTransactions

HarryRose
Thanks,  having re-checked out the code from the master development branch of your repo, I can confirm that I am now receiving subscriptions.  However, the CustomerInfo is null.  Is this a bug in the simulation?

        Received a market message: null-354744-SIGNUP-0.0

The PowerTac*.log file shows

2011-07-13 21:06:31,282 [DefaultMessageListenerContainer-1] DEBUG messaging.MessageListenerRegistrar  - getAssignableRegistrations(class org.powertac.common.TariffTransaction) - start
2011-07-13 21:06:31,282 [DefaultMessageListenerContainer-1] DEBUG messaging.MessageListenerRegistrar  - getAssignableRegistrations(class org.powertac.common.TariffTransaction) - end [org.powertac.broker.core.tariffnegotiator.DemoTariffNegotiator@2686a13f, org.powertac.broker.infrastructure.messaging.MarketMessageListener@7653537c]
2011-07-13 21:06:31,283 [DefaultMessageListenerContainer-1] DEBUG tariffnegotiator.DemoTariffNegotiator  - onMessage(TariffTransaction) - start
2011-07-13 21:06:31,291 [DefaultMessageListenerContainer-1] DEBUG tariffnegotiator.DemoTariffNegotiator  - onMessage(TariffTransaction) - end
2011-07-13 21:06:31,291 [DefaultMessageListenerContainer-1] DEBUG messaging.MarketMessageListener  - onMessage(org.powertac.common.TariffTransaction) - start
2011-07-13 21:06:31,291 [DefaultMessageListenerContainer-1] DEBUG messaging.MarketMessageListener  - onMessage(org.powertac.common.TariffTransaction) - saving...
2011-07-13 21:06:31,291 [DefaultMessageListenerContainer-1] DEBUG persistence.MessagePersistenceManager  - save(TariffTransaction) - start
2011-07-13 21:06:31,298 [DefaultMessageListenerContainer-1] DEBUG persistence.MessagePersistenceManager  - save(TariffTransaction) - receving SIGNUP ttx for grailsDemo
2011-07-13 21:06:31,298 [DefaultMessageListenerContainer-1] DEBUG persistence.MessagePersistenceManager  - save(TariffTransaction) - end
2011-07-13 21:06:31,300 [DefaultMessageListenerContainer-1] DEBUG messaging.MarketMessageListener  - onMessage(org.powertac.common.TariffTransaction) - end

And the XML

<list>
  <distribution-tx id="1" quantity="0.0000" charge="0.0000">
    <broker>grailsDemo</broker>
    <postedTime>
      <iMillis>1277078400000</iMillis>
    </postedTime>
  </distribution-tx>
  <tariff-tx id="6" txType="SIGNUP" customerCount="8" quantity="0.0" charge="0.0">
    <broker reference="../../distribution-tx/broker"/>
    <customerInfo>82d7e097-c1f6-44ce-98cd-19987ef44b8c</customerInfo>
    <postedTime reference="../../distribution-tx/postedTime"/>
    <tariffSpec>1eae9fd4-721c-4423-893c-1695e8f18a48</tariffSpec>
  </tariff-tx>
  <cash balance="-99.1659">
    <broker reference="../../distribution-tx/broker"/>
    <id>2</id>
  </cash>
  <bank-tx amount="-0.027405071095015367">
    <broker reference="../../distribution-tx/broker"/>
    <postedTime reference="../../distribution-tx/postedTime"/>
  </bank-tx>
  <tariff-tx id="5" txType="PUBLISH" customerCount="0" quantity="0.0" charge="-100.0">
    <broker reference="../../distribution-tx/broker"/>
    <postedTime reference="../../distribution-tx/postedTime"/>
    <tariffSpec reference="../../tariff-tx/tariffSpec"/>
  </tariff-tx>
  <balance-tx id="1" quantity="0.0000" charge="0.8615">
    <broker reference="../../distribution-tx/broker"/>
    <postedTime reference="../../distribution-tx/postedTime"/>
  </balance-tx>
  <tariff-tx id="7" txType="SIGNUP" customerCount="8" quantity="0.0" charge="0.0">
    <broker reference="../../distribution-tx/broker"/>
    <customerInfo>2f59690e-471a-4a83-b4bc-1326fafe98fc</customerInfo>
    <postedTime reference="../../distribution-tx/postedTime"/>
    <tariffSpec reference="../../tariff-tx/tariffSpec"/>
  </tariff-tx>
</list>