Calculating amount of money on broker's account.

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

Calculating amount of money on broker's account.

Jesus
This post was updated on .
Hello all,

We have been trying to calculate the amount of money in the broker's account too see in which part of the simulation the broker has made and lost money. When comparing our calculations to the actual CashBalance of the broker there is money missing in our calculation. We have been getting the values from the Market Transaction, Balancing transaction, Distribution Transaction, Bank Transaction, Tariff transaction and payments from the tariff specification. Do we need to calculate the daily interest that is charged on a daily basis from the broker's account or is that already being calculated in the bank transaction?  Also, I know that every time that the broker publishes a new tariff a fee of 5000 is charged to the broker but i am not sure from what object I can get that value from or where it is on the log file.If anyone has any idea where I can find this values and what other values I might be missing your help would be greatly appreciated.

Thank you,
Jesus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calculating amount of money on broker's account.

grampajohn
Administrator
Jesus wrote
We have been trying to calculate the amount of money in the broker's account too see in which part of the simulation the broker has made and lost money. When comparing our calculations to the actual CashBalance of the broker there is money missing in our calculation. We have been getting the values from the Market Transaction, Balancing transaction, Distribution Transaction, Bank Transaction, Tariff transaction and payments from the tariff specification. Do we need to calculate the daily interest that is charged on a daily basis from the broker's account or is that already being calculated in the bank transaction?  Also, I know that every time that the broker publishes a new tariff a fee of 5000 is charged to the broker but i am not sure from what object I can get that value from or where it is on the log file.If anyone has any idea where I can find this values and what other values I might be missing your help would be greatly appreciated.
The bank accounts are maintained by the Accounting service. It uses the various subtypes of BrokerTransaction, and it computes the bank interest and generates the accompanying BankTransaction. I don't understand what you mean by "payments from the tariff specification" -- all those payments are conveyed in TariffTransactions, including publication costs. Keep in mind that the interest on a positive  balance is half the interest on a negative balance. It's possible that you are misinterpreting a sign somewhere.

Beyond that, we would need more information, such as an example of the list of transactions for your broker in a timeslot, the associated change in cash balance, and of course the specific game configuration you are using.

Cheers -

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

Re: Calculating amount of money on broker's account.

Jesus
Thank you for your response. I have been calculating the values in each of the markets to see the overall gains and costs for each time slot and the overall of all the time slots. I am doing this by fetching the values of each transaction and storing them in one variable for each type of market. (Ex. NetMarketPrice, NetDistributionPrice.) I seem to be getting all the values correctly except for the tariff transaction.I am wondering how exactly the Tariff Transaction works. When I add all the values from all the different types of transactions and compare it to the CashPosition I am 20k off the value in the CashPosition. I am only adding the the tariff transactions of type CONSUME and PUBLISH. I am also wondering why I need to specify the types of transactions I need to add in the Tariff Market, shouldn't it just add all the types when calling getCharge() in the TariffTransaction?

Thank you,
Jesus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calculating amount of money on broker's account.

grampajohn
Administrator
Jesus wrote
... I seem to be getting all the values correctly except for the tariff transaction.I am wondering how exactly the Tariff Transaction works. When I add all the values from all the different types of transactions and compare it to the CashPosition I am 20k off the value in the CashPosition. I am only adding the the tariff transactions of type CONSUME and PUBLISH.
There are quite a few types of TariffTransaction - if you are ignoring some of them, then your accounting will be incorrect. Exactly which ones get used will depend on which features of TariffSpecification you are using. There can be signup and withdrawal payments when customers change subscriptions. If you revoke a tariff, you get charged, and may have to make a refund to some customers. If your tariff has a fixed part and a per-kWh part (as most real-world tariffs do), then you will have periodic payments.
I am also wondering why I need to specify the types of transactions I need to add in the Tariff Market, shouldn't it just add all the types when calling getCharge() in the TariffTransaction?
Yes, you should use all the types you see - some may never show up, depending on which features you are using. Other than that, I am not sure I understand the question.

Cheers -

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

Re: Calculating amount of money on broker's account.

Jesus
Thank you for your response. Continuing on the same topic, when I use all the types of Tariff Transactions my calculations go over the correct cash amount about 600K and when I only use the types of CONSUME and PUBLISH I am under the correct cash amount by 20K. These differences are at the last time slot when i get the final Cash Position and my final Cash amount from the calculations I have made.

Thank you,
Jesus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calculating amount of money on broker's account.

grampajohn
Administrator
Jesus wrote
... when I use all the types of Tariff Transactions my calculations go over the correct cash amount about 600K and when I only use the types of CONSUME and PUBLISH I am under the correct cash amount by 20K. These differences are at the last time slot when i get the final Cash Position and my final Cash amount from the calculations I have made.
Are you doing this from a server log, or a broker log? State log or trace log? It's possible something is not being logged correctly, but I'm not sure what it would be.

Cheers -

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

Re: Calculating amount of money on broker's account.

Jesus
I have been doing this from the server log and state logs. I have been using a TariffTransactionHandler, DistributionTransactionHandler, MarketTransactionHandler, BalancingTransactionHandler and BankTransactionHandler to get the values I need. Should I download the server code from Github to see what it's doing different?

Thank you,
Jesus
Loading...