question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong prediction in future stop list in CIM scenario 🐛

See original GitHub issue

Description

While estimating future vessel stops in VesselFutureStopsPrediction there is a bug in the starting point when last_loc_idx == next_loc_idx.

In particular, when the previous condition is satisfied, the predictions retrieved by VesselFutureStopsPrediction._predict_future_stops() are one step ahead.

Screenshots

To Reproduce

To reproduce the behavior, just run the following snippet of code.

from maro.backends.frame import SnapshotList
from maro.simulator import Env
from pprint import pprint
from typing import List
import numpy as np

# Initialize an Env for CIM scenario
env = Env(scenario="cim", topology="toy.4p_ssdd_l0.0", start_tick=0, durations=1120)
    
# Start the environment with None action
_, event, is_done = env.step(None)

while not is_done:
    metrics, event, is_done = env.step(None)

vessel_snapshots = env.snapshot_list["vessels"]
print(vessel_snapshots[[i for i in range(0, 20)]:2:['future_stop_list', 'future_stop_tick_list', 'last_loc_idx']].reshape(20, 7))

For toy.4p_ssdd_l0.0 vessel arrivals happen every 7 steps. You can see that when at t such that t % 7 == 0, predictions will jump one step ahead.

Expected Behavior

When last_loc_idx == next_loc_idx predictions should not be 1-step ahead.

Environment

  • MARO version (e.g., v0.1.1a1): master
  • MARO scenario (CIM, Citi Bike): CIM
  • MARO component (Simulation, RL, Distributed Training): Simulation
  • Orchestration platform (GraSS on Azure, AKS on Azure):
  • How you installed MARO (pip, source): source
  • OS (Linux, Windows, macOS): Linux
  • Python version (3.6, 3.7): 3.7
  • Docker image (e.g., arthursjiang/maro:cpu[5f36ed]):
  • CPU/GPU:
  • Any other relevant information:

Additional Context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
riccardopoianicommented, Jun 29, 2021

Hi @Jinyu-W thanks very much for the fix. Seems to be working to me 😃

I’ll let you know if I’ll find some other problems in the future. For now, I consider this issue closed.

1reaction
Jinyu-Wcommented, Jun 29, 2021

Hi @riccardopoiani , we’ve added the parking port idx into the vessel in PR #366, please check the master branch and try the attributes below:

        is_parking    # Is parking or not, 1 means parking, 0 means sailing.
        loc_port_idx  # The port index the vessel is parking at.
Read more comments on GitHub >

github_iconTop Results From Across the Web

When Corporate Innovation Goes Bad - CB Insights
Understanding failure is crucial since so many accounts of innovation focus on the successes and so are affected by survivorship bias. This is ......
Read more >
Releases · microsoft/maro - GitHub
Simulator/CIM Scenario: Fix the environment reset issue #385, and update the simulator random seed interfaces (#387); Fix the "Wrong future stop ...
Read more >
Download - DiVA portal
Adding a new path to a final state will result in new test cases, or it may result in an error in the...
Read more >
Security of smart manufacturing systems - ScienceDirect.com
In this paper, we discuss the security of existing industrial and manufacturing systems, existing vulnerabilities, potential future cyber-attacks, ...
Read more >
Using Scenario Planning to think about the future
Events will shape the future in many different ways, and it's impossible to predict everything that will happen tomorrow, let alone 5 or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found