widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #13699
Re: [Merge] lp:~widelands-dev/widelands/frisian_balancing_with_ai_hints into lp:widelands
Review: Approve
Code looks good, just one small comment in diff
Diff comments:
>
> === modified file 'src/ai/defaultai.cc'
> --- src/ai/defaultai.cc 2018-04-29 09:20:29 +0000
> +++ src/ai/defaultai.cc 2018-06-12 05:09:38 +0000
> @@ -2901,14 +3039,16 @@
> }
> }
>
> - // This is for a special case this is also supporter, it considers
> - // producers nearby
> - for (auto ph : bo.production_hints) {
> - prio += management_data.neuron_pool[51].get_result_safe(
> - bf->producers_nearby.at(ph) * 5, kAbsValue) /
> - 2;
> - }
> -
> + // considering neededness depending on stocklevel
> + const uint32_t current_stocklevel = (get_stocklevel(bo, gametime));
Brackets around get_stocklevel are not needed
> + if (current_stocklevel > 50 &&
> + persistent_data->remaining_basic_buildings.count(bo.id) == 0) {
> + continue;
> + }
> + if (current_stocklevel < 40) {
> + prio += 5 * management_data.neuron_pool[23].get_result_safe(
> + (40 - current_stocklevel) / 2, kAbsValue);
> + }
> // This considers supporters nearby
> for (auto ph : bo.outputs) {
> prio += management_data.neuron_pool[52].get_result_safe(
--
https://code.launchpad.net/~widelands-dev/widelands/frisian_balancing_with_ai_hints/+merge/347166
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/frisian_balancing_with_ai_hints.
References