hlsyounes / mdpsim

PPDDL plan evalutation simulator
Apache License 2.0
14 stars 5 forks source link

time_left is converted from long to int in mdpserver.cc #6

Closed GoogleCodeExporter closed 4 years ago

GoogleCodeExporter commented 9 years ago
The time left before the end of the current round is different in the logs
and in the XML message sent to the client.

What steps will reproduce the problem?
1. Run a server for the coffee domain
2. Run a client for the coffee domain and print the time left node of the
round initial XML message
3. Read the log of your session in /path/to/mdpsim/logs/yourclient-coffee

What is the expected output? What do you see instead?

You should notice that time-left is set to 10000 in the logs, but it is set
to 899999 in the round initial XML node.

What version of the product are you using? On what operating system?
I am using mdpsim-2.2.2

Please provide any additional information below.

I noticed that time_left is declared as a long variable in the host_problem
function, but is then past as an int variable to the LogRoundInit function.
Nevertheless, it does not explain this bug to me, since 10000 can be stored
in an int variable.

Original issue reported on code.google.com by florent....@gmail.com on 24 Mar 2008 at 9:10

hlsyounes commented 4 years ago

I can't reproduce this issue, but I switched to std::chrono::milliseconds to help catch potential narrowing bugs at compile time.