Skip to content

Commit

Permalink
fixes operator test
Browse files Browse the repository at this point in the history
  • Loading branch information
nmisek committed Mar 18, 2024
1 parent 03b568a commit 09a1c24
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 59 deletions.
173 changes: 116 additions & 57 deletions tests/custom_operators/input.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -75,70 +75,20 @@
"name": "1 * vehicles_duration + 1 * unplanned_penalty",
"objectives": [
{
"base": 621.4304640293121,
"factor": 1,
"name": "vehicles_duration",
"value": 0
"value": 621.4304640293121
},
{
"base": 7000000,
"factor": 1,
"name": "unplanned_penalty",
"value": 7000000
"value": 0
}
],
"value": 7000000
"value": 621.4304640293121
},
"unplanned": [
{
"id": "Arashiyama Bamboo Forest",
"location": {
"lat": 35.017209,
"lon": 135.672009
}
},
{
"id": "Fushimi Inari Taisha",
"location": {
"lat": 34.967146,
"lon": 135.772695
}
},
{
"id": "Gionmachi",
"location": {
"lat": 35.002457,
"lon": 135.775682
}
},
{
"id": "Kinkaku-ji",
"location": {
"lat": 35.039705,
"lon": 135.728898
}
},
{
"id": "Kiyomizu-dera",
"location": {
"lat": 34.994857,
"lon": 135.78506
}
},
{
"id": "Kyoto Imperial Palace",
"location": {
"lat": 35.025431,
"lon": 135.762057
}
},
{
"id": "Nijō Castle",
"location": {
"lat": 35.014239,
"lon": 135.748134
}
}
],
"unplanned": [],
"vehicles": [
{
"id": "v1",
Expand All @@ -156,6 +106,20 @@
}
},
"travel_duration": 0
},
{
"arrival_time": "2023-01-01T06:00:00-06:00",
"cumulative_travel_duration": 0,
"end_time": "2023-01-01T06:00:00-06:00",
"start_time": "2023-01-01T06:00:00-06:00",
"stop": {
"id": "Arashiyama Bamboo Forest",
"location": {
"lat": 35.017209,
"lon": 135.672009
}
},
"travel_duration": 0
}
],
"route_duration": 0,
Expand All @@ -177,10 +141,105 @@
}
},
"travel_duration": 0
},
{
"arrival_time": "2023-01-01T06:00:00-06:00",
"cumulative_travel_duration": 0,
"end_time": "2023-01-01T06:00:00-06:00",
"start_time": "2023-01-01T06:00:00-06:00",
"stop": {
"id": "Kinkaku-ji",
"location": {
"lat": 35.039705,
"lon": 135.728898
}
},
"travel_duration": 0
},
{
"arrival_time": "2023-01-01T06:02:46-06:00",
"cumulative_travel_distance": 3329,
"cumulative_travel_duration": 166,
"end_time": "2023-01-01T06:02:46-06:00",
"start_time": "2023-01-01T06:02:46-06:00",
"stop": {
"id": "Nijō Castle",
"location": {
"lat": 35.014239,
"lon": 135.748134
}
},
"travel_distance": 3329,
"travel_duration": 166
},
{
"arrival_time": "2023-01-01T06:04:15-06:00",
"cumulative_travel_distance": 5105,
"cumulative_travel_duration": 255,
"end_time": "2023-01-01T06:04:15-06:00",
"start_time": "2023-01-01T06:04:15-06:00",
"stop": {
"id": "Kyoto Imperial Palace",
"location": {
"lat": 35.025431,
"lon": 135.762057
}
},
"travel_distance": 1776,
"travel_duration": 88
},
{
"arrival_time": "2023-01-01T06:06:37-06:00",
"cumulative_travel_distance": 7944,
"cumulative_travel_duration": 397,
"end_time": "2023-01-01T06:06:37-06:00",
"start_time": "2023-01-01T06:06:37-06:00",
"stop": {
"id": "Gionmachi",
"location": {
"lat": 35.002457,
"lon": 135.775682
}
},
"travel_distance": 2839,
"travel_duration": 141
},
{
"arrival_time": "2023-01-01T06:07:37-06:00",
"cumulative_travel_distance": 9145,
"cumulative_travel_duration": 457,
"end_time": "2023-01-01T06:07:37-06:00",
"start_time": "2023-01-01T06:07:37-06:00",
"stop": {
"id": "Kiyomizu-dera",
"location": {
"lat": 34.994857,
"lon": 135.78506
}
},
"travel_distance": 1201,
"travel_duration": 60
},
{
"arrival_time": "2023-01-01T06:10:21-06:00",
"cumulative_travel_distance": 12425,
"cumulative_travel_duration": 621,
"end_time": "2023-01-01T06:10:21-06:00",
"start_time": "2023-01-01T06:10:21-06:00",
"stop": {
"id": "Fushimi Inari Taisha",
"location": {
"lat": 34.967146,
"lon": 135.772695
}
},
"travel_distance": 3280,
"travel_duration": 164
}
],
"route_duration": 0,
"route_travel_duration": 0
"route_duration": 621,
"route_travel_distance": 12425,
"route_travel_duration": 621
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions tests/custom_operators/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func NewCustomUnPlanSearchOperator() nextroute.SolveOperator {
return &customUnplanImpl{
nextroute.NewSolveOperator(
1.0,
false,
true,
nextroute.SolveParameters{},
),
}
Expand Down Expand Up @@ -140,7 +140,7 @@ func NewCustomPlanSearchOperator() nextroute.SolveOperator {
return &customPlanImpl{
SolveOperator: nextroute.NewSolveOperator(
1.0,
false,
true,
nextroute.SolveParameters{},
),
}
Expand Down

0 comments on commit 09a1c24

Please sign in to comment.