![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "city.h"
Include dependency graph for cm.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | cm_parameter |
| struct | cm_result |
Functions | |
| void | cm_init () |
| Initialize the CM data at the start of each game. More... | |
| void | cm_init_citymap () |
| Initialize the CM citymap data. More... | |
| void | cm_free () |
| Called at the end of a game to free any CM data. More... | |
| std::unique_ptr< cm_result > | cm_result_new (struct city *pcity) |
| Create a new cm_result. More... | |
| void | cm_query_result (struct city *pcity, const struct cm_parameter *const parameter, std::unique_ptr< cm_result > &result, bool negative_ok) |
| Wrapper that actually runs the branch & bound, and returns the best solution. More... | |
| bool | operator== (const struct cm_parameter &p1, const struct cm_parameter &p2) |
| void | cm_copy_parameter (struct cm_parameter *dest, const struct cm_parameter *const src) |
| Copy the parameter from the source to the destination field. More... | |
| void | cm_init_parameter (struct cm_parameter *dest) |
| Initialize the parameter to sane default values. More... | |
| void | cm_init_emergency_parameter (struct cm_parameter *dest) |
| Initialize the parameter to sane default values that will always produce a result. More... | |
| void | cm_print_city (const struct city *pcity) |
| Debugging routines. More... | |
| void | cm_print_result (const std::unique_ptr< cm_result > &result) |
| Print debugging information about a full CM result. More... | |
| int | cm_result_citizens (const std::unique_ptr< cm_result > &result) |
| Count the total number of citizens in the result. More... | |
| int | cm_result_specialists (const std::unique_ptr< cm_result > &result) |
| Count the total number of specialists in the result. More... | |
| int | cm_result_workers (const std::unique_ptr< cm_result > &result) |
| Count the total number of workers in the result. More... | |
| void | cm_result_from_main_map (std::unique_ptr< cm_result > &result, const struct city *pcity) |
| Copy the city's current setup into the cm result structure. More... | |
| void cm_copy_parameter | ( | struct cm_parameter * | dest, |
| const struct cm_parameter *const | src | ||
| ) |
Copy the parameter from the source to the destination field.
Definition at line 2163 of file cm.cpp.
Referenced by auto_arrange_workers(), begin_search(), cmafec_get_fe_parameter(), cmafec_preset_add(), handle_city_manager(), and package_city().
| void cm_free | ( | ) |
Called at the end of a game to free any CM data.
Definition at line 315 of file cm.cpp.
Referenced by game_free().
| void cm_init | ( | ) |
Initialize the CM data at the start of each game.
Note the citymap indices will not have been initialized yet (cm_init_citymap is called when they are).
Definition at line 288 of file cm.cpp.
Referenced by game_init().
| void cm_init_citymap | ( | ) |
Initialize the CM citymap data.
This function is called when the city map indices are generated (basically when the topology is set, shortly after the start of the game).
Definition at line 307 of file cm.cpp.
Referenced by generate_city_map_indices().
| void cm_init_emergency_parameter | ( | struct cm_parameter * | dest | ) |
Initialize the parameter to sane default values that will always produce a result.
Definition at line 2192 of file cm.cpp.
Referenced by auto_arrange_workers().
| void cm_init_parameter | ( | struct cm_parameter * | dest | ) |
Initialize the parameter to sane default values.
Definition at line 2172 of file cm.cpp.
Referenced by auto_arrange_workers(), cmafec_get_fe_parameter(), dai_manage_taxes(), and cma_yoloswag::get_parameter().
| void cm_print_city | ( | const struct city * | pcity | ) |
Debugging routines.
Print debugging information about one city.
Definition at line 2432 of file cm.cpp.
Referenced by cma_yoloswag::apply_result_on_server(), auto_arrange_workers(), and cma_yoloswag::result_came_from_server().
| void cm_print_result | ( | const std::unique_ptr< cm_result > & | result | ) |
Print debugging information about a full CM result.
Definition at line 2472 of file cm.cpp.
Referenced by cma_yoloswag::apply_result_on_server(), auto_arrange_workers(), and cma_yoloswag::result_came_from_server().
| void cm_query_result | ( | struct city * | pcity, |
| const struct cm_parameter *const | parameter, | ||
| std::unique_ptr< cm_result > & | result, | ||
| bool | negative_ok | ||
| ) |
Wrapper that actually runs the branch & bound, and returns the best solution.
Definition at line 2115 of file cm.cpp.
Referenced by auto_arrange_workers(), dai_manage_taxes(), and cma_yoloswag::handle_city().
| int cm_result_citizens | ( | const std::unique_ptr< cm_result > & | result | ) |
Count the total number of citizens in the result.
Definition at line 2246 of file cm.cpp.
Referenced by cma_yoloswag::apply_result_on_server().
Copy the city's current setup into the cm result structure.
Wrapper for cm_result_main().
Definition at line 2255 of file cm.cpp.
Referenced by cma_yoloswag::apply_result_on_server(), and cma_yoloswag::result_came_from_server().
Create a new cm_result.
Definition at line 330 of file cm.cpp.
Referenced by cma_yoloswag::apply_result_on_server(), auto_arrange_workers(), dai_manage_taxes(), cma_yoloswag::handle_city(), and cma_yoloswag::result_came_from_server().
| int cm_result_specialists | ( | const std::unique_ptr< cm_result > & | result | ) |
Count the total number of specialists in the result.
Definition at line 2233 of file cm.cpp.
Referenced by cm_result_citizens().
| int cm_result_workers | ( | const std::unique_ptr< cm_result > & | result | ) |
Count the total number of workers in the result.
Definition at line 2211 of file cm.cpp.
Referenced by cm_print_result(), and cm_result_citizens().
| bool operator== | ( | const struct cm_parameter & | p1, |
| const struct cm_parameter & | p2 | ||
| ) |