← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/ai_variables_rework into lp:widelands

 

http://www.cplusplus.com/reference/deque/deque/:

> For operations that involve frequent insertion or removals of elements at positions other than the beginning or the end, deques perform worse and have less consistent iterators and references than lists and forward lists.

dequeue over vector can give you some gain here, but I don't understand your decision to replace lists by dequeues, since you're erasing from the middle. If you only need to iterate a list forwards, you can use a forward_list to save some memory.

Diff comments:

> 
> === modified file 'src/ai/defaultai_warfare.cc'
> --- src/ai/defaultai_warfare.cc	2017-09-29 16:10:25 +0000
> +++ src/ai/defaultai_warfare.cc	2017-10-31 17:41:52 +0000
> @@ -948,6 +956,10 @@
>  	const uint16_t total_score = scores[0] + scores[1] + scores[2];
>  
>  	int32_t inputs[4 * kFNeuronBitSize] = {0};

Variable is not static.

> +	// Reseting values as the variable is static
> +	for (int i = 0; i < 4 * kFNeuronBitSize; i++) {
> +		inputs[i] = 0;
> +	}
>  	inputs[0] = (msites_total < 1) ? 1 : 0;
>  	inputs[1] = (msites_total < 2) ? 1 : 0;
>  	inputs[2] = (msites_total < 3) ? 1 : 0;


-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_variables_rework/+merge/333041
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_variables_rework into lp:widelands.


References