Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SAEV Greedy Fleet Sizing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romain BERNARD
SAEV Greedy Fleet Sizing
Commits
69a9deb6
Commit
69a9deb6
authored
9 months ago
by
Romain BERNARD
Browse files
Options
Downloads
Patches
Plain Diff
remove const identifier in BestRequestInsertion to use those values in insertion algorithm
parent
3b34090d
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Route manipulation API with automatic constraint propagation
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/routes/vehicle/BestRequestInsertion.h
+5
-5
5 additions, 5 deletions
src/routes/vehicle/BestRequestInsertion.h
src/routes/vehicle/SAEVRoute.cpp
+9
-9
9 additions, 9 deletions
src/routes/vehicle/SAEVRoute.cpp
with
14 additions
and
14 deletions
src/routes/vehicle/BestRequestInsertion.h
+
5
−
5
View file @
69a9deb6
...
...
@@ -13,8 +13,8 @@
class
BestRequestInsertion
{
private:
const
SAEVKeyPoint
*
_originInsertionKP
;
const
SAEVKeyPoint
*
_destinationInsertionKP
;
SAEVKeyPoint
*
_originInsertionKP
;
SAEVKeyPoint
*
_destinationInsertionKP
;
double
_score
{
std
::
numeric_limits
<
double
>::
max
()
};
public
:
...
...
@@ -28,11 +28,11 @@ public:
* @param destinationInsertionKP Index of insertion for the destination of the request in the route
* @param score
*/
BestRequestInsertion
(
const
SAEVKeyPoint
*
originInsertionKP
,
const
SAEVKeyPoint
*
destinationInsertionKP
,
double
score
)
BestRequestInsertion
(
SAEVKeyPoint
*
originInsertionKP
,
SAEVKeyPoint
*
destinationInsertionKP
,
double
score
)
:
_originInsertionKP
(
originInsertionKP
),
_destinationInsertionKP
(
destinationInsertionKP
),
_score
(
score
)
{};
[[
nodiscard
]]
const
SAEVKeyPoint
*
getOriginInsertionKp
()
const
{
[[
nodiscard
]]
SAEVKeyPoint
*
getOriginInsertionKp
()
{
return
_originInsertionKP
;
}
...
...
@@ -40,7 +40,7 @@ public:
_originInsertionKP
=
originInsertionKp
;
}
[[
nodiscard
]]
const
SAEVKeyPoint
*
getDestinationInsertionKp
()
const
{
[[
nodiscard
]]
SAEVKeyPoint
*
getDestinationInsertionKp
()
{
return
_destinationInsertionKP
;
}
...
...
This diff is collapsed.
Click to expand it.
src/routes/vehicle/SAEVRoute.cpp
+
9
−
9
View file @
69a9deb6
...
...
@@ -369,20 +369,20 @@ BestInsertionQueue SAEVRoute::getBestInsertionsQueue(size_t requestId, size_t ve
//Init variables used during iteration
double
score
;
SAEVKeyPoint
const
*
originKeyPoint
=
&
getOriginDepot
(
vehicleId
);
SAEVKeyPoint
const
*
destinationKeyPoint
=
originKeyPoint
;
SAEVKeyPoint
*
origin
Insertion
KeyPoint
=
&
getOriginDepot
(
vehicleId
);
SAEVKeyPoint
*
destination
Insertion
KeyPoint
=
origin
Insertion
KeyPoint
;
//iterate over possible origin/destination pairs for the given vehicle
while
(
originKeyPoint
->
getSuccessor
()
!=
nullptr
)
{
while
(
destinationKeyPoint
->
getSuccessor
()
!=
nullptr
)
{
score
=
getDetourScore
(
requestId
,
*
originKeyPoint
,
*
destinationKeyPoint
);
bestInsertionQueue
.
emplace
(
originKeyPoint
,
destinationKeyPoint
,
score
);
destinationKeyPoint
=
destinationKeyPoint
->
getSuccessor
();
while
(
origin
Insertion
KeyPoint
->
getSuccessor
()
!=
nullptr
)
{
while
(
destination
Insertion
KeyPoint
->
getSuccessor
()
!=
nullptr
)
{
score
=
getDetourScore
(
requestId
,
*
origin
Insertion
KeyPoint
,
*
destination
Insertion
KeyPoint
);
bestInsertionQueue
.
emplace
(
origin
Insertion
KeyPoint
,
destination
Insertion
KeyPoint
,
score
);
destination
Insertion
KeyPoint
=
destination
Insertion
KeyPoint
->
getSuccessor
();
}
//Iterate over possible origins and reset destination to being the same point as the origin
originKeyPoint
=
originKeyPoint
->
getSuccessor
();
destinationKeyPoint
=
originKeyPoint
;
origin
Insertion
KeyPoint
=
origin
Insertion
KeyPoint
->
getSuccessor
();
destination
Insertion
KeyPoint
=
origin
Insertion
KeyPoint
;
}
return
bestInsertionQueue
;
...
...
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