Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Vroom HQ
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ADAS
Vroom HQ
Commits
5978849c
Commit
5978849c
authored
1 year ago
by
David Vronka
Browse files
Options
Downloads
Patches
Plain Diff
left a right time window of customer is scaling too
parent
87ec2dc6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/py/Recreate_problem_from_BM.py
+40
-9
40 additions, 9 deletions
scripts/py/Recreate_problem_from_BM.py
with
40 additions
and
9 deletions
scripts/py/Recreate_problem_from_BM.py
+
40
−
9
View file @
5978849c
...
@@ -218,15 +218,46 @@ if __name__ == "__main__":
...
@@ -218,15 +218,46 @@ if __name__ == "__main__":
# index=0
# index=0
problem_definitions
=
json_data
[
"
Problem Definitions
"
]
problem_definitions
=
json_data
[
"
Problem Definitions
"
]
# for k, v in problem_definitions.items():
for
k
,
v
in
problem_definitions
.
items
():
# for i in range(len(v["Customers"]["jobs"])):
# scaling time_windows at customers
# json_data["Problem Definitions"][k]['Customers']['jobs'][i]['service']=round(problem_definitions[k]['Customers']['jobs'][i]['service']*scaling_factor)
if
"
jobs
"
in
v
[
"
Customers
"
]:
# json_data["Problem Definitions"][k]['Customers']['jobs'][i]['time_windows'][0][0]=json_data["Vehicle Definitions"][2]["Big ICE"]["time_window"][0]
for
i
in
range
(
len
(
v
[
"
Customers
"
][
"
jobs
"
])):
# json_data["Problem Definitions"][k]['Customers']['jobs'][i]['time_windows'][0][1]=json_data["Vehicle Definitions"][2]["Big ICE"]["time_window"][1]
# json_data["Problem Definitions"][k]['Customers']['jobs'][i]['service']=round(problem_definitions[k]['Customers']['jobs'][i]['service']*scaling_factor)
# for i in range(len(v["Customers"]["shipments"])):
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
jobs
"
][
i
][
# json_data["Problem Definitions"][k]['Customers']['shipments'][i]['service']=round(problem_definitions[k]['Customers']['shipments'][i]['service']*scaling_factor)
"
time_windows
"
# json_data["Problem Definitions"][k]['Customers']['shipments'][i]['time_windows'][0][0]=json_data["Vehicle Definitions"][2]["Big ICE"]["time_window"][0]
][
0
][
0
]
=
(
# json_data["Problem Definitions"][k]['Customers']['shipments'][i]['time_windows'][0][1]=json_data["Vehicle Definitions"][2]["Big ICE"]["time_window"][1]
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
jobs
"
][
i
][
"
time_windows
"
][
0
][
0
]
*
scaling_factor
)
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
jobs
"
][
i
][
"
time_windows
"
][
0
][
1
]
=
(
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
jobs
"
][
i
][
"
time_windows
"
][
0
][
1
]
*
scaling_factor
)
if
"
shipments
"
in
v
[
"
Customers
"
]:
for
i
in
range
(
len
(
v
[
"
Customers
"
][
"
shipments
"
])):
# json_data["Problem Definitions"][k]['Customers']['shipments'][i]['service']=round(problem_definitions[k]['Customers']['shipments'][i]['service']*scaling_factor)
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
shipments
"
][
i
][
"
time_windows
"
][
0
][
0
]
=
(
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
shipments
"
][
i
][
"
time_windows
"
][
0
][
0
]
*
scaling_factor
)
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
shipments
"
][
i
][
"
time_windows
"
][
0
][
1
]
=
(
json_data
[
"
Problem Definitions
"
][
k
][
"
Customers
"
][
"
shipments
"
][
i
][
"
time_windows
"
][
0
][
1
]
*
scaling_factor
)
for
k
,
v
in
problem_definitions
.
items
():
for
k
,
v
in
problem_definitions
.
items
():
for
i
in
range
(
len
(
v
[
"
Matrices
"
])):
for
i
in
range
(
len
(
v
[
"
Matrices
"
])):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment