Remove global fallback candidate action
This literally did nothing except place useless labels on the map.
This commit is contained in:
parent
d73a2486ba
commit
fbd9edd5df
8 changed files with 0 additions and 239 deletions
|
@ -191,8 +191,6 @@
|
|||
<Unit filename="../../src/ai/testing/aspect_attacks.hpp" />
|
||||
<Unit filename="../../src/ai/testing/ca.cpp" />
|
||||
<Unit filename="../../src/ai/testing/ca.hpp" />
|
||||
<Unit filename="../../src/ai/testing/ca_global_fallback.cpp" />
|
||||
<Unit filename="../../src/ai/testing/ca_global_fallback.hpp" />
|
||||
<Unit filename="../../src/ai/testing/ca_testing_move_to_targets.cpp" />
|
||||
<Unit filename="../../src/ai/testing/ca_testing_move_to_targets.hpp" />
|
||||
<Unit filename="../../src/ai/testing/ca_testing_recruitment.cpp" />
|
||||
|
|
|
@ -2235,62 +2235,6 @@
|
|||
RelativePath="..\..\src\ai\testing\ca.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_global_fallback.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug_with_VLD|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Test_Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Test_Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="ReleaseDEBUG|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_global_fallback.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_testing_move_to_targets.cpp"
|
||||
>
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
49DA0D2E13550E9B000AFEBD /* iterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA0D2B13550E9B000AFEBD /* iterator.cpp */; };
|
||||
49DA0D2F13550E9B000AFEBD /* walker_grid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA0D2C13550E9B000AFEBD /* walker_grid.cpp */; };
|
||||
49DA0D3013550E9B000AFEBD /* walker_widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA0D2D13550E9B000AFEBD /* walker_widget.cpp */; };
|
||||
49DA0D3613550F27000AFEBD /* ca_global_fallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA0D3513550F27000AFEBD /* ca_global_fallback.cpp */; };
|
||||
49E84DC217384EF800A4F376 /* leader_scroll_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E84DC017384EF800A4F376 /* leader_scroll_dialog.cpp */; };
|
||||
620091C31575C784009AA2C9 /* filter_options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 620091C11575C784009AA2C9 /* filter_options.cpp */; };
|
||||
620A386E15E9364E00A4F513 /* attack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 620A386215E9364E00A4F513 /* attack.cpp */; };
|
||||
|
@ -1109,7 +1108,6 @@
|
|||
49DA0D2B13550E9B000AFEBD /* iterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = iterator.cpp; path = iterator/iterator.cpp; sourceTree = "<group>"; };
|
||||
49DA0D2C13550E9B000AFEBD /* walker_grid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = walker_grid.cpp; path = iterator/walker_grid.cpp; sourceTree = "<group>"; };
|
||||
49DA0D2D13550E9B000AFEBD /* walker_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = walker_widget.cpp; path = iterator/walker_widget.cpp; sourceTree = "<group>"; };
|
||||
49DA0D3513550F27000AFEBD /* ca_global_fallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ca_global_fallback.cpp; sourceTree = "<group>"; };
|
||||
49E84DC017384EF800A4F376 /* leader_scroll_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = leader_scroll_dialog.cpp; sourceTree = "<group>"; };
|
||||
49E84DC117384EF800A4F376 /* leader_scroll_dialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = leader_scroll_dialog.hpp; sourceTree = "<group>"; };
|
||||
620091C11575C784009AA2C9 /* filter_options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_options.cpp; sourceTree = "<group>"; };
|
||||
|
@ -2284,7 +2282,6 @@
|
|||
F419E43E13354E220031448A /* teleport.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = teleport.hpp; sourceTree = "<group>"; };
|
||||
F419E44313354E620031448A /* lua_jailbreak_exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_jailbreak_exception.hpp; sourceTree = "<group>"; };
|
||||
F419E44413354E620031448A /* lua_jailbreak_exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_jailbreak_exception.cpp; sourceTree = "<group>"; };
|
||||
F419E46213354F8D0031448A /* ca_global_fallback.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ca_global_fallback.hpp; sourceTree = "<group>"; };
|
||||
F419E485133550FB0031448A /* drawing.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = drawing.hpp; sourceTree = "<group>"; };
|
||||
F444907513C5483E003B6442 /* joystick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = joystick.cpp; sourceTree = "<group>"; };
|
||||
F444907613C5483E003B6442 /* joystick.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = joystick.hpp; sourceTree = "<group>"; };
|
||||
|
@ -3515,8 +3512,6 @@
|
|||
children = (
|
||||
B59F96E51034791200A57C1A /* aspect_attacks.cpp */,
|
||||
B59F96E61034791200A57C1A /* aspect_attacks.hpp */,
|
||||
49DA0D3513550F27000AFEBD /* ca_global_fallback.cpp */,
|
||||
F419E46213354F8D0031448A /* ca_global_fallback.hpp */,
|
||||
B552D92A108694BB002D8F86 /* ca_testing_move_to_targets.cpp */,
|
||||
B552D92B108694BB002D8F86 /* ca_testing_move_to_targets.hpp */,
|
||||
B5CE46FB12A041CE00D665EE /* ca_testing_recruitment.cpp */,
|
||||
|
@ -4355,7 +4350,6 @@
|
|||
62D24F2D1519982500350848 /* brush.cpp in Sources */,
|
||||
B5599AD40EC62181008DD061 /* button.cpp in Sources */,
|
||||
B5A9BD5B0ECA805A002BE442 /* button.cpp in Sources */,
|
||||
49DA0D3613550F27000AFEBD /* ca_global_fallback.cpp in Sources */,
|
||||
B552D92D108694BB002D8F86 /* ca_testing_move_to_targets.cpp in Sources */,
|
||||
B5CE46FD12A041CE00D665EE /* ca_testing_recruitment.cpp in Sources */,
|
||||
B54AC6E60FEA9EB5006F6FBD /* ca.cpp in Sources */,
|
||||
|
|
|
@ -718,7 +718,6 @@ set(wesnoth-main_SRC
|
|||
ai/testing.cpp
|
||||
ai/testing/aspect_attacks.cpp
|
||||
ai/testing/ca.cpp
|
||||
ai/testing/ca_global_fallback.cpp
|
||||
ai/testing/ca_testing_move_to_targets.cpp
|
||||
ai/testing/ca_testing_recruitment.cpp
|
||||
ai/testing/stage_rca.cpp
|
||||
|
|
|
@ -243,7 +243,6 @@ wesnoth_sources = Split("""
|
|||
ai/testing.cpp
|
||||
ai/testing/aspect_attacks.cpp
|
||||
ai/testing/ca.cpp
|
||||
ai/testing/ca_global_fallback.cpp
|
||||
ai/testing/ca_testing_move_to_targets.cpp
|
||||
ai/testing/ca_testing_recruitment.cpp
|
||||
ai/testing/stage_rca.cpp
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "recruitment/recruitment.hpp" // for recruitment
|
||||
#include "testing/aspect_attacks.hpp" // for aspect_attacks
|
||||
#include "testing/ca.hpp" // for leader_shares_keep_phase, etc
|
||||
#include "testing/ca_global_fallback.hpp" // for global_fallback_phase
|
||||
#include "testing/ca_testing_move_to_targets.hpp"
|
||||
#include "testing/ca_testing_recruitment.hpp"
|
||||
#include "testing/stage_sf_with_rca.hpp"
|
||||
|
@ -122,9 +121,6 @@ static register_candidate_action_factory<testing_ai_default::leader_shares_keep_
|
|||
static register_candidate_action_factory<testing_ai_default::leader_shares_keep_phase>
|
||||
passive_leader_shares_keep_phase_factory("ai_default_rca::passive_leader_shares_keep_phase");
|
||||
|
||||
static register_candidate_action_factory<testing_ai_default::global_fallback_phase>
|
||||
global_fallback_phase_factory("ai_default_rca::global_fallback_phase");
|
||||
|
||||
static register_candidate_action_factory<default_recruitment::recruitment>
|
||||
default_recruitment_factory("default_recruitment::recruitment");
|
||||
|
||||
|
@ -168,9 +164,6 @@ static register_candidate_action_factory<testing_ai_default::testing_recruitment
|
|||
static register_candidate_action_factory<testing_ai_default::leader_shares_keep_phase>
|
||||
old_passive_leader_shares_keep_phase_factory("testing_ai_default::passive_leader_shares_keep_phase");
|
||||
|
||||
static register_candidate_action_factory<testing_ai_default::global_fallback_phase>
|
||||
old_global_fallback_phase_factory("testing_ai_default::global_fallback_phase");
|
||||
|
||||
// =======================================================================
|
||||
// Goals
|
||||
// =======================================================================
|
||||
|
|
|
@ -1,107 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2009 - 2016 by Yurii Chernyi <terraninfo@terraninfo.net>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Defensive fallback, to be used during unfavorable conditions
|
||||
*/
|
||||
|
||||
#include "ca_global_fallback.hpp"
|
||||
|
||||
#include "ai/composite/ai.hpp"
|
||||
|
||||
#include "game_display.hpp"
|
||||
#include "log.hpp"
|
||||
#include "map/map.hpp"
|
||||
#include "map/label.hpp"
|
||||
#include "replay.hpp"
|
||||
#include "resources.hpp"
|
||||
#include "sdl/utils.hpp"
|
||||
#include "team.hpp"
|
||||
#include "terrain/filter.hpp"
|
||||
#include "tod_manager.hpp"
|
||||
#include "units/unit.hpp"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
namespace ai {
|
||||
|
||||
namespace testing_ai_default {
|
||||
|
||||
static lg::log_domain log_ai_testing_ca_global_fallback("ai/ca/global_fallback");
|
||||
#define DBG_AI LOG_STREAM(debug, log_ai_testing_ca_global_fallback)
|
||||
#define LOG_AI LOG_STREAM(info, log_ai_testing_ca_global_fallback)
|
||||
#define WRN_AI LOG_STREAM(warn, log_ai_testing_ca_global_fallback)
|
||||
#define ERR_AI LOG_STREAM(err, log_ai_testing_ca_global_fallback)
|
||||
|
||||
//==================================
|
||||
// aux utils
|
||||
//
|
||||
|
||||
static void display_label(int /*side*/, const map_location& location, const std::string& text, bool surrounded)
|
||||
{
|
||||
display* gui = display::get_singleton();
|
||||
std::string team_name;
|
||||
|
||||
SDL_Color color = int_to_color(team::get_side_rgb(surrounded ? 2 : 1 ) );//@fixme: for tests
|
||||
|
||||
const terrain_label *res;
|
||||
res = gui->labels().set_label(location, text, surrounded, team_name, color);
|
||||
if (res && resources::recorder)
|
||||
resources::recorder->add_label(res);
|
||||
}
|
||||
|
||||
|
||||
//==================================
|
||||
|
||||
global_fallback_phase::global_fallback_phase( rca_context &context, const config &cfg )
|
||||
: candidate_action(context,cfg)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
global_fallback_phase::~global_fallback_phase()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
double global_fallback_phase::evaluate()
|
||||
{
|
||||
return get_score();
|
||||
}
|
||||
|
||||
|
||||
void global_fallback_phase::execute()
|
||||
{
|
||||
LOG_AI << "start" << std::endl;
|
||||
const int ticks = SDL_GetTicks();
|
||||
double res_sum = 0;
|
||||
BOOST_FOREACH( unit &u, *resources::units)
|
||||
{
|
||||
if (u.side()!=get_side())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
double res = 0.1; //@todo: how badly the unit 'u' will be hurt by enemy
|
||||
res_sum += res;
|
||||
display_label(get_side(),u.get_location(),str_cast(res),false);
|
||||
}
|
||||
LOG_AI << "sum is " << res_sum << std::endl;
|
||||
|
||||
LOG_AI << "end in [" << (SDL_GetTicks()-ticks) << "] ticks" << std::endl;
|
||||
}
|
||||
|
||||
} // end of namespace testing_ai_default
|
||||
|
||||
} // end of namespace ai
|
|
@ -1,59 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2009 - 2016 by Yurii Chernyi <terraninfo@terraninfo.net>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Strategic movement routine, for experimentation
|
||||
*/
|
||||
|
||||
#ifndef AI_TESTING_CA_TESTING_GLOBAL_FALLBACK_HPP_INCLUDED
|
||||
#define AI_TESTING_CA_TESTING_GLOBAL_FALLBACK_HPP_INCLUDED
|
||||
|
||||
#include "ai/composite/rca.hpp"
|
||||
|
||||
#include "units/map.hpp"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
//silence "inherits via dominance" warnings
|
||||
#pragma warning(disable:4250)
|
||||
#endif
|
||||
|
||||
namespace ai {
|
||||
|
||||
namespace testing_ai_default {
|
||||
|
||||
class global_fallback_phase : public candidate_action {
|
||||
public:
|
||||
|
||||
global_fallback_phase( rca_context &context, const config &cfg );
|
||||
|
||||
virtual ~global_fallback_phase();
|
||||
|
||||
virtual double evaluate();
|
||||
|
||||
virtual void execute();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
} // of namespace testing_ai_default
|
||||
|
||||
} // of namespace ai
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue