Skip to main content

How to create input variable to my Vehicle platooning problem?

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi John,

    You can add a time by extending the multidict as

    location,cost,time = gp.multidict({
    ("A","B"): [12, 320],
    ("C","A"): [10, 600],
    ("A","D"): [12, 120],
    ("D","B"): [15, 450],
    ("F","B"): [20, 1200],
    ("C","D"): [17, 720],
    ("F","C"): [19, 240],
    ("C","E"): [15, 300],
    ("F","E"): [11, 360]})

    The keys of the multidict will be stored in location, the first entries of the lists will be stored in cost, and the second entries of the lists will be stored in time. Please, have a look at the documentation of multidict for more details and the examples diet.py and netflow.py for applications.

    Best regards,
    Jaromił

    1

Post is closed for comments.