farhanrahman / kyoto

18 stars 7 forks source link

getCurrentTick returns 0 #30

Closed tumblerer closed 12 years ago

tumblerer commented 12 years ago

timeService.getCurrentTick() currently always returns 0.

This is quite a serious issue as it is used to calculate year ends etc.

azyzio commented 12 years ago

How did you find it out? Through simulation or JUnitTesting? I guess the reason for it is that Time Service is not registered for Event Bus (I don't really understand how it works), but I would like to debug it to make sure. The thing is that I haven't played with running simulations yet.

Sergeus commented 12 years ago

Simulation. I'm working on fixing this now.

Sergeus commented 12 years ago

I've got a temporary fix working for now that basically uses SimTime to give tick values. But the event stuff isn't cooperating, so I've sent Sam Macbeth an email asking him about it. If anyone is well-versed in event-related setup stuff and can take a look at TimeService on the testing branch, then let me know because I cannot get it to subscribe to the event bus. (I've done the stuff on the presage2.info Q&A forum, the injected setter literally just never runs for no reason whatsoever.)

Sergeus commented 12 years ago

Interesting development with this bug. Participant environment services (like TimeService) cannot, in this version of presage2, interact with the event bus. (Explains why it was so frustratingly not working.) I'm gonna create a new TimeService that's a global environment service so it can generate events, and change our current timeService so it can relate information to agents.

azyzio commented 12 years ago

Eh... Presage...

Sergeus commented 12 years ago

I have fixed time. See commits 1ff20b4 and e93aed5.