From f6d463f8f2e30cd4a633a7aab36f17ce56e513f5 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 9 May 2013 04:54:57 +0200 Subject: digital/io-hub/src/apbirthday: change initial plate taking --- digital/io-hub/src/apbirthday/strat.hh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'digital/io-hub/src/apbirthday/strat.hh') diff --git a/digital/io-hub/src/apbirthday/strat.hh b/digital/io-hub/src/apbirthday/strat.hh index 3e6c7264..1f4365c6 100644 --- a/digital/io-hub/src/apbirthday/strat.hh +++ b/digital/io-hub/src/apbirthday/strat.hh @@ -49,6 +49,13 @@ class Strat /// Information on a plate decision. struct PlateDecision { + /// Chosen plate. + int plate; + /// Leave movement after plate is taken. + bool leave; + /// Approach position, where the robot should be before starting + /// approaching. + Position approaching_pos; /// Loading position, point where to go backward to load the plate. If /// the point is reached, there is no plate. vect_t loading_pos; @@ -65,7 +72,13 @@ class Strat /// Movement direction. Asserv::DirectionConsign dir; }; + /// Number of plates. + static const int plate_nb = 10; public: + /// Constructor. + Strat (); + /// Color specific initialisation. + void color_init (); /// Return new decision and associated position. Decision decision (Position &pos); /// Take a decision related to candles, return false to give up candles. @@ -77,11 +90,20 @@ class Strat void decision_gifts (GiftsDecision &decision); /// Report a failure to apply the previous decision. void failure (); + /// Report a success. + void success (); private: + /// Compute best score for a plate. + int score_plate (Position &pos); + private: + /// Last taken decision. + Decision last_decision_; /// Last plate decision. PlateDecision plate_decision_; /// Last gifts decision. GiftsDecision gifts_decision_; + /// Plate visited? + bool plate_visited_[plate_nb]; }; #endif // strat_hh -- cgit v1.2.3