Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
interval.hpp
00001 #ifndef RIDE_INTERVAL_HPP
00002 #define RIDE_INTERVAL_HPP
00003 
00004 #include <map>
00005 #include <list>
00006 #include <vector>
00007 #include "ride/formation.hpp"
00008 //#include "kernel/jafarException.hpp"
00009 //#include "ride/rideException.hpp"
00010 
00011 
00012 namespace jafar {
00013 
00014     namespace ride {
00015 
00025         class SplitGroup {
00026             private :
00027                 int id;
00028                 Vect position;
00029                 int size;
00030                 std::list<int> idList;
00031                 std::list<std::pair<UAVType,int> > typeList;
00032             public :
00033                 SplitGroup();
00034                 SplitGroup(int id_, Vect pos, int size_);
00035                 ~SplitGroup();
00036                 int getId() const;
00037                 Vect getPosition() const;
00038                 int getSize() const;
00039                 void addId(int id_);
00040                 void addId(std::list<int> idList_);
00041                 void addType(UAVType type, int nb);
00042                 std::list<int> getIdList() const;
00043                 std::list<std::pair<UAVType,int> > getTypeList() const;
00044                 bool isInGroup(int id_) const;
00045         };
00046         
00051         typedef std::list<SplitGroup> SplitParam;
00052 
00057         enum THREAT_PRIORITY {
00058             HIGH,NORMAL,LOW
00059         };
00060 
00066         class Interval {
00067             private :
00068                 int startWP,endWP;
00069                 double Dmin,Dmax,corridor;
00070                 std::vector<tagSlot> formation;
00071                 std::map<int,bool> defence;
00072                 SplitParam splitParam;
00073             public :
00074                 Interval(int startWP_, int endWP_,
00075                         double Dmin_ = GC::DMIN,
00076                         double Dmax_ = GC::DMAX,
00077                         double corridor_ = GC::CORRIDOR);
00078                 ~Interval();
00079                 int getStartWP() const;
00080                 int getEndWP() const;
00081                 bool isInRange(int wpId) const;
00082                 double getDmin() const;
00083                 void setDmin(double Dmin_);
00084                 double getDmax()const;
00085                 void setDmax(double Dmax_);
00086                 double getCorridor() const;
00087                 void setCorridor(double corridor_);
00088                 std::vector<tagSlot> getFormation() const;
00089                 void setFormation(std::vector<tagSlot> form);
00090                 bool isFormValid(int size) const;
00091                 THREAT_PRIORITY defenceFromThreat(int id) const;
00092                 void setDefence(int id, bool def);
00093                 SplitParam getSplitParam() const;
00094                 void setSplit(SplitParam split);
00095         };
00096 
00097     }
00098 
00099 }
00100 
00101 #endif
00102 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:26 for Jafar by doxygen 1.7.6.1
LAAS-CNRS