farhanrahman / kyoto

18 stars 7 forks source link

Yearly function happening before new targets are set #117

Closed sc1109 closed 12 years ago

sc1109 commented 12 years ago

Currenty, the yearly function which should take new targets into account to decide behaviour for the next year, happens before those targets are set.

One solution is to continue the 'monitor calls everything in order' fix for carbon target, but this is messy and feels wrong.

sc1109 commented 12 years ago

@Sergeus We'll talk about this tomorrow

piotroslaw commented 12 years ago

I may not be in early tomorrow, so I will outline the problem here in case you discuss this without me:

Chain of events before the change:

  1. behaviour() (in last tick of year N)
  2. Monitor
  3. Set new targets
  4. Yearly function
  5. behaviour() (in first tick of year N+1)

Chain of events now:

  1. behaviour() (in last tick of year N)
  2. Yearly function
  3. behaviour() (in first tick of year N+1)
  4. Monitor
  5. Set new targets

Two massive problems with this:

To make matters even worse, in the first year, emission targets are assigned at the end not of the first tick, but second.

I realise the change was introduced to rectify some problems with emission targets, but they pretty much broken the behaviour of my agent (and probably others' as well), and honestly, the way it works now makes absolutely no sense from the point of writing behaviour.

If possible, please restore the chain of events as it was before. Without this finalised and working properly, there is no way to finish and test strategies.

piotroslaw commented 12 years ago

solved, as it is now, we have two-tick period at the beginning of each year, where you behaviour() isn't triggered. yearly function will happen before the second tick in the first year of simulation, and before the third tick (the first that triggers your behaviour() in all other years). Also, monitoring and setting targets is now done before yearly function.

So, the chain of event is as it should be (and as was before), with the only difference that step 5 is behaviour() of the third tick of the year instead of the first, which hopefully doesn't break anything for anyone.