Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pdptw-main
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
JACQ-BODET Awen
pdptw-main
Compare revisions
9ef014fa1c976b5c4a62d9a9a2deea68f8ea8879 to 0a8185f280514e1f416e600890c0a4a009bb0691
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
a24jacqb/pdptw-main
Select target project
No results found
0a8185f280514e1f416e600890c0a4a009bb0691
Select Git revision
Swap
Target
a24jacqb/pdptw-main
Select target project
a24jacqb/pdptw-main
1 result
9ef014fa1c976b5c4a62d9a9a2deea68f8ea8879
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+61
-6
61 additions, 6 deletions
src/main.cpp
with
61 additions
and
6 deletions
src/main.cpp
View file @
0a8185f2
...
@@ -12,16 +12,23 @@
...
@@ -12,16 +12,23 @@
#include
"input/location.h"
#include
"input/location.h"
#include
"input/time_window.h"
#include
"input/time_window.h"
#include
"input/json_parser.h"
#include
"input/json_parser.h"
#include
"input/data.h"
#include
"lns/constraints/capacity/capacity_constraint.h"
#include
"lns/constraints/time_window/time_window_constraint.h"
#include
"lns/solution/solution.h"
#include
"lns/modification/pair/insert_pair.h"
#include
"lns/modification/route/insert_route.h"
#include
"lns/modification/pair/remove_pair.h"
#include
"lns/modification/route/remove_route.h"
namespace
fs
=
std
::
filesystem
;
namespace
fs
=
std
::
filesystem
;
using
json
=
nlohmann
::
json
;
using
json
=
nlohmann
::
json
;
int
main
(
int
argc
,
char
const
*
argv
[])
int
main
(
int
argc
,
char
const
*
argv
[])
{
{
/* code */
//std::string filepath = "/home/a24jacqb/Documents/Code/pdptw-main/data_in/test_inst.json";
//std::string filepath = "/home/a24jacqb/Documents/Code/pdptw-main/data_in/test_inst.json";
std
::
string
filepath
=
"/home/a24jacqb/Documents/Code/pdptw-main/data_in/n100/bar-n100-1.json"
;
//std::string filepath = "/home/a24jacqb/Documents/Code/pdptw-main/data_in/n100/bar-n100-1.json";
std
::
string
filepath
=
"/home/a24jacqb/Documents/Code/pdptw-main/data_in/Nantes_1.json"
;
//std::string filepath = "/home/a24jacqb/Documents/Code/pdptw-main/data_in/n5000/bar-n5000-1.json";
//std::string filepath = "/home/a24jacqb/Documents/Code/pdptw-main/data_in/n5000/bar-n5000-1.json";
std
::
cout
<<
filepath
<<
"
\n
"
;
std
::
cout
<<
filepath
<<
"
\n
"
;
...
@@ -29,13 +36,61 @@ int main(int argc, char const *argv[])
...
@@ -29,13 +36,61 @@ int main(int argc, char const *argv[])
PDPTWData
data
=
parsing
::
parseJson
(
filepath
);
PDPTWData
data
=
parsing
::
parseJson
(
filepath
);
data
.
checkData
();
data
.
checkData
();
/* test */
/*
TimeWindow
tw
=
TimeWindow
(
3
,
4
);
* test
Location
pos
=
Location
(
1
,
1
,
20
,
3
,
tw
,
4
,
5
,
LocType
::
DEPOT
);
*/
Solution
emptySol
=
Solution
(
data
);
// SOLUTION 1-6-2-7 (time ; 104)
Solution
::
RequestBank
bank
{
3
,
4
,
5
,
8
,
9
,
10
};
std
::
vector
<
int
>
path
{
1
,
2
,
6
,
7
};
Route
route
=
Route
(
path
,
0
);
std
::
vector
<
Route
>
routes
;
routes
.
push_back
(
route
);
int
totalCost
=
0
;
Solution
sol
=
Solution
(
data
,
bank
,
routes
,
totalCost
);
sol
.
print
();
// Couple pickup/delivery
Location
r2P
=
data
.
getLocations
()[
1
];
Location
r2D
=
data
.
getLocations
()[
6
];
Location
r3P
=
data
.
getLocations
()[
2
];
Location
r3D
=
data
.
getLocations
()[
7
];
Pair
pair2
=
Pair
(
r2P
,
r2D
);
Pair
pair3
=
Pair
(
r3P
,
r3D
);
// Modification
InsertPair
opInsert
=
InsertPair
(
0
,
2
,
2
,
pair3
);
/*
CapacityConstraint cap_const = CapacityConstraint(sol);
cap_const.initCapacities();
cap_const.print();
std::cout << "Is Valid ? : " << cap_const.checkVariant(opInsert) << "\n";
cap_const.applyVariant(opInsert);
cap_const.print();
RemovePair opRemove = RemovePair(0, 2, 3, pair3);
cap_const.applyVariant(opRemove);
cap_const.print();
*/
TimeWindowConstraint
twconst
=
TimeWindowConstraint
(
sol
);
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next