61 std::unique_ptr<cm_result> &result,
bool negative_ok);
79 const struct city *pcity);
void cm_init()
Initialize the CM data at the start of each game.
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.
void cm_copy_parameter(struct cm_parameter *dest, const struct cm_parameter *const src)
Copy the parameter from the source to the destination field.
void cm_free()
Called at the end of a game to free any CM data.
void cm_init_parameter(struct cm_parameter *dest)
Initialize the parameter to sane default values.
int cm_result_citizens(const std::unique_ptr< cm_result > &result)
Count the total number of citizens in the result.
bool operator==(const struct cm_parameter &p1, const struct cm_parameter &p2)
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.
void cm_init_citymap()
Initialize the CM citymap data.
int cm_result_workers(const std::unique_ptr< cm_result > &result)
Count the total number of workers in the result.
std::unique_ptr< cm_result > cm_result_new(struct city *pcity)
Create a new cm_result.
void cm_init_emergency_parameter(struct cm_parameter *dest)
Initialize the parameter to sane default values that will always produce a result.
void cm_print_result(const std::unique_ptr< cm_result > &result)
Print debugging information about a full CM result.
void cm_print_city(const struct city *pcity)
Debugging routines.
int cm_result_specialists(const std::unique_ptr< cm_result > &result)
Count the total number of specialists in the result.
cm_parameter & operator=(const cm_parameter &other)=default
Copy assignment operator.
int minimal_surplus[O_LAST]
std::vector< bool > worker_positions
citizens specialists[SP_MAX]