Closed georgePil closed 12 years ago
1) quantity is double since both carbonOffset and carbonOutput is double
2) Currently there is no function to let the person who initiated the offer using the offer method know that the trade was accepted. The variables should be automatically adjusted after successful trade. If not then nothing happens. I can add a function that calls a function in the country that the trade was rejected and then allow the country to analyse that thing. Ideally you don't really need that because you can see it from the change in carbon output. It should be implied in the logic that you create.
3) There is no way for a country to wait for future offers. ITS A MIND FUCK to do that as presage FSM protocols transitions depend on messages received from another party. I tried doing it but TradeProtocol is as complicated as it is now so it was agreed in the beginning that it should be kept simple like this.
you misunderstood me on point 2. I'll go through an example here.
Two agents in Lalaland: George Max
1) George wants to buy some carbon. So he sends a broadcast message 2) Max receives the message and decides to respond to the offer. So he calls the offer function in his tradeProtocol, which starts a conversation between the two. Max then waits in the TRADE_PROPOSED state 3) George sees what Max has to offer and then sends a reply back to Max that he likes it. Now here is the thing, George (the responder) DOES KNOW THAT THE TRADE HAS HAPPENED. 4) Max receives the acceptance. Now here MAX DOES NOT GET A CONFIRMATION TO HIMSELF THAT THE TRADE HAS BEEN COMPLETED, even though carbonOffset and cash gets adjusted. I can add a function that lets the initiator know that the trade has been successful. 5) The trade completes and they lived happily ever after..
Oh and yeah Im not too sure which version of Abstract country I have because the one i have has carbonOutput and offset as type double.
I hope it helps man.. just let me know if you require any more function in the TradeProtocol
Man check your phone :p
@farhanrahman you are a legend :D
I started implementing the CDM function in the country's behaviour but I am a bit stuck in some points:
and 3. how can a country choose which offer is the best to go forward and accept it?
If I am missing any documentation on this please let me know..
Thanks