Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Krabi
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
Container registry
Model registry
Operate
Environments
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
Victor
Krabi
Commits
4c1e3b56
Commit
4c1e3b56
authored
5 years ago
by
Victor Dubois
Browse files
Options
Downloads
Patches
Plain Diff
restart using more attractors (up to 16)
parent
073b3bc1
Branches
standAloneStrategy
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stm32/src/strategie/goldo2018.cpp
+26
-19
26 additions, 19 deletions
stm32/src/strategie/goldo2018.cpp
with
26 additions
and
19 deletions
stm32/src/strategie/goldo2018.cpp
+
26
−
19
View file @
4c1e3b56
...
...
@@ -127,18 +127,19 @@ Goldo2018::Goldo2018(bool isYellow) : StrategieV3(isYellow)
#else
//positionsCart.push_back(std::make_pair(300, 300));//OK test left
//
positionsCart.push_back(std::make_pair(301, 450));//OK mid-red
positionsCart
.
push_back
(
std
::
make_pair
(
301
,
450
));
//OK mid-red
positionsCart
.
push_back
(
std
::
make_pair
(
700
,
450
));
//OK out of red
positionsCart
.
push_back
(
std
::
make_pair
(
700
,
7
50
));
//OK out of green
positionsCart
.
push_back
(
std
::
make_pair
(
300
,
75
0
));
//OK mid green
//
positionsCart.push_back(std::make_pair(300,
120
0));// mid
blue
//
positionsCart.push_back(std::make_pair(700, 1
2
00));// out of blue
positionsCart
.
push_back
(
std
::
make_pair
(
700
,
8
50
));
//OK out of green
positionsCart
.
push_back
(
std
::
make_pair
(
300
,
60
0
));
//OK mid
red/
green
positionsCart
.
push_back
(
std
::
make_pair
(
300
,
75
0
));
//
mid
green
positionsCart
.
push_back
(
std
::
make_pair
(
700
,
1
3
00
));
// out of blue
positionsCart
.
push_back
(
std
::
make_pair
(
1700
,
450
));
// out of top of accel
positionsCart
.
push_back
(
std
::
make_pair
(
1700
,
300
));
// in front of top of accel
positionsCart
.
push_back
(
std
::
make_pair
(
2250
,
450
));
// out of goldenium
positionsCart
.
push_back
(
std
::
make_pair
(
2250
,
300
));
// in front of goldenium
positionsCart
.
push_back
(
std
::
make_pair
(
1500
,
800
));
// waypoint behind backhole
//positionsCart.push_back(std::make_pair(1000, 700));// 2nd waypoint behind backhole disabled because of weird bug
positionsCart
.
push_back
(
std
::
make_pair
(
2000
,
800
));
// 2nd waypoint behind backhole
positionsCart
.
push_back
(
std
::
make_pair
(
1200
,
450
));
// waypoint begin
//m_attractors = attractors;
...
...
@@ -150,28 +151,28 @@ Goldo2018::Goldo2018(bool isYellow) : StrategieV3(isYellow)
// Création des étapes
// Les étapes correspondant à des actions sont créées automatiquement lors de l'ajout d'actions
for
(
int
i
=
0
;
i
<
12
;
i
++
)
{
for
(
int
i
=
0
;
i
<
positionsCart
.
size
()
;
i
++
)
{
positionFromAttractor
(
i
);
}
// Initialisation in simulator in initKrabi.cpp
//int start = Etape::makeEtape(positionFromAttractor(0), Etape::DEPART); // départ au fond de la zone de départ
int
attractorId
=
0
;
int
mid_red
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
),
Etape
::
DEPART
);
// départ au fond de la zone de départ
//int start = Etape::makeEtape(Position(200, 350, true), Etape::DEPART); // départ au fond de la zone de départ
// COLORS
int
mid_red
=
Etape
::
makeEtape
(
Position
(
0
,
0
,
true
),
Etape
::
DEPART
);
int
attractorId
=
0
;
//int mid_red = Etape::makeEtape(Position(0,0, true), Etape::DEPART);
int
out_of_red
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
));
Etape
::
get
(
mid_red
)
->
addVoisins
(
out_of_red
);
// out of start
int
out_of_green
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
));
int
mid_green
=
Etape
::
makeEtape
(
new
Abeille
(
positionFromAttractor
(
attractorId
++
)));
Etape
::
get
(
mid_green
)
->
addVoisins
(
out_of_green
);
// push greenium
int
mid
dle_red
_green
=
Etape
::
makeEtape
(
new
Abeille
(
positionFromAttractor
(
attractorId
++
)));
Etape
::
get
(
mid
dle_red
_green
)
->
addVoisins
(
out_of_green
);
// push
redium from
greenium
Etape
::
get
(
out_of_red
)
->
addVoisins
(
out_of_green
);
// From red to green
//
int mid_
blue
= Etape::makeEtape(new Abeille(positionFromAttractor(attractorId++)));
//
int out_of_blue = Etape::makeEtape(positionFromAttractor(attractorId++));
//
Etape::get(mid_
blue
)->addVoisins(out_of_blue);// push blue
//
Etape::get(out_of_blue)->addVoisins(out_of_green);// from green to blue
int
mid_
green
=
Etape
::
makeEtape
(
new
Abeille
(
positionFromAttractor
(
attractorId
++
)));
int
out_of_blue
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
));
Etape
::
get
(
mid_
green
)
->
addVoisins
(
out_of_blue
);
// push
greenium from
blue
Etape
::
get
(
out_of_blue
)
->
addVoisins
(
out_of_green
);
// from green to blue
// ACCELERATOR
int
out_of_top_of_accel
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
));
...
...
@@ -191,10 +192,16 @@ Etape::get(out_of_green)->addVoisins(waypoint_behind_backhole);// green to waypo
Etape
::
get
(
out_of_red
)
->
addVoisins
(
waypoint_behind_backhole
);
// red to waypoint
Etape
::
get
(
out_of_top_of_accel
)
->
addVoisins
(
waypoint_behind_backhole
);
// accel to waypoint
//int second_waypoint_behind_backhole = Etape::makeEtape(positionFromAttractor(11));
//Etape::get(out_of_top_of_accel)->addVoisins(second_waypoint_behind_backhole);// accel to 2waypoint
//Etape::get(waypoint_behind_backhole)->addVoisins(second_waypoint_behind_backhole);// waypoint to 2waypoint
int
second_waypoint_behind_backhole
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
));
Etape
::
get
(
out_of_top_of_accel
)
->
addVoisins
(
second_waypoint_behind_backhole
);
// accel to 2waypoint
Etape
::
get
(
waypoint_behind_backhole
)
->
addVoisins
(
second_waypoint_behind_backhole
);
// waypoint to 2waypoint
Etape
::
get
(
out_of_goldenium
)
->
addVoisins
(
second_waypoint_behind_backhole
);
// waypoint to 2waypoint
int
waypoint_begin
=
Etape
::
makeEtape
(
positionFromAttractor
(
attractorId
++
));
Etape
::
get
(
out_of_top_of_accel
)
->
addVoisins
(
waypoint_begin
);
// accel to 3waypoint
Etape
::
get
(
waypoint_behind_backhole
)
->
addVoisins
(
waypoint_begin
);
// waypoint to 3waypoint
Etape
::
get
(
out_of_red
)
->
addVoisins
(
waypoint_begin
);
// red to 3waypoint
Etape
::
get
(
out_of_green
)
->
addVoisins
(
waypoint_begin
);
// red to 3waypoint
// Reservoir eau proche
//int reservoirProche = Etape::makeEtape(new ReservoirEau(Position(220, 840, true)));
...
...
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