Suggestion/bug fix of Flatland 2.0

Hi flatland team!

Just a few questions about current version of Flatland.

  1. I found that sometimes agent.malfunction_data['next_malfunction'] parameter can be below zero. It happens when the next malfunction for a single agent occurs before current ended (I can send a simulation code, if you want). So, a flatland user have to write one extra line to find out a next_malfunction value. Personally I use this code:

next_malfunction = max(self.env.agents[ind].malfunction_data['next_malfunction'], self.env.agents[ind].malfunction_data['malfunction'] + 1)

Please, fix your next_malfunction output with something like that to avoid any of misunderstandings.

  1. And one more question. Do you want to allow the agent to wait (with STOP_MOVING status) when its position_fraction is upper than zero - I mean when the agent started to move between two cells? I ask this as long as right now agents are unable to do that, which looks not so logical.

  2. What values of malfunction_rate and max_duration will you set in simulations (sorry, if I ask this too early).

P. S. Thank you for past bug fixs. Now, it is possible to make full solutions for round 2. You`ve done a great job!

Hi @vetrov_andrew

Thanks for these great inputs.

  1. We will look into this and fix it such that next_malfunction is alwas greater or equal to zero.
  2. Currently we don’t want to allow agents to stop in the middle of the cell. (Positional fraction largen than 0). There is some real railway specific considerations such as reserved blocks that are similar to this behavior. But more importantly we disabled this to simplify the use of machine learning algorithms with the environment. If we allow stop actions in the middle of cells. then the controller needs to make much more observations and not only at cell changes. (Not set in stone and could be updated if the need arises)
  3. We are working on the exact values for malfunction_rate and max_duration. They will most likely be rare and not too long. Duration should be of a lenght that alternative routes are a meaningful strategy to improve punctuality. Malfunction rate should be kept low such that agents only break a few times.

We are working hard to make the final release happen this week.

Best regards,

The Flatland team

  1. I’ll fix this today:
  2. I’m putting @mlerik’s explantation of this design choice in the documentation

@vetrov_andrew Thanks for your positive feedback. And thank you for your inputs!