Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AI_TESTING_CA_TESTING_MOVE_TO_TARGETS_HPP_INCLUDED
00022 #define AI_TESTING_CA_TESTING_MOVE_TO_TARGETS_HPP_INCLUDED
00023
00024 #include "../composite/rca.hpp"
00025
00026 #include "../../unit_map.hpp"
00027
00028 #ifdef _MSC_VER
00029 #pragma warning(push)
00030
00031 #pragma warning(disable:4250)
00032 #endif
00033
00034 namespace pathfind {
00035
00036 struct plain_route;
00037
00038 }
00039
00040 namespace ai {
00041
00042 namespace testing_ai_default {
00043
00044 class testing_move_to_targets_phase : public candidate_action {
00045 public:
00046
00047 testing_move_to_targets_phase( rca_context &context, const config &cfg );
00048
00049 virtual ~testing_move_to_targets_phase();
00050
00051 virtual double evaluate();
00052
00053 virtual void execute();
00054
00055 protected:
00056 void access_points(const move_map& srcdst, const map_location& u, const map_location& dst, std::vector<map_location>& out);
00057
00058 std::pair<map_location,map_location> choose_move(std::vector<target>& targets, const move_map& srcdst, const move_map& dstsrc, const move_map& enemy_dstsrc);
00059
00060 double compare_groups(const std::set<map_location>& our_group, const std::set<map_location>& their_group, const std::vector<map_location>& battlefield) const;
00061
00062 void enemies_along_path(const std::vector<map_location>& route, const move_map& dstsrc, std::set<map_location>& res);
00063
00064 map_location form_group(const std::vector<map_location>& route, const move_map& dstsrc, std::set<map_location>& res);
00065
00066 bool move_group(const map_location& dst, const std::vector<map_location>& route, const std::set<map_location>& units);
00067
00068 double rate_group(const std::set<map_location>& group, const std::vector<map_location>& battlefield) const;
00069
00070
00071
00072
00073
00074 double rate_target(const target& tg, const unit_map::iterator& u,
00075 const move_map& dstsrc, const move_map& enemy_dstsrc,
00076 const pathfind::plain_route& rt);
00077
00078 bool should_retreat(const map_location& loc, const unit_map::const_iterator& un,
00079 const move_map& srcdst, const move_map& dstsrc, const move_map& enemy_dstsrc,
00080 double caution);
00081 };
00082
00083 }
00084
00085 }
00086
00087 #ifdef _MSC_VER
00088 #pragma warning(pop)
00089 #endif
00090
00091 #endif