[Freeciv-Dev] [patch #3715] Threaded AI cities generating Worker task requests
Follow-up Comment #6, patch #3715 (project freeciv): I committed my warning workaround, since no better ideas were suggested and it stops me building. ___ Reply to this item at: http://gna.org/patch/?3715 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3715] Threaded AI cities generating Worker task requests
Follow-up Comment #4, patch #3715 (project freeciv): Unfortunately this is giving warnings for me (GCC 4.4.3-4ubuntu5.1 on Ubuntu 10.04): taicity.c: In function ‘tai_city_worker_requests_create’: taicity.c:56: error: ‘task.tgt.type’ may be used uninitialized in this function taicity.c:56: error: ‘task.act’ may be used uninitialized in this function It seems clear that these are to me untrue, but I'm not sure how to persuade the compiler of that. Attached patch has the obvious workaround. (file #17525) ___ Additional Item Attachment: File name: trunk-taicity-worker-task-init.patch Size:0 KB ___ Reply to this item at: http://gna.org/patch/?3715 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3715] Threaded AI cities generating Worker task requests
Update of patch #3715 (project freeciv): Status: Ready For Test = Done Assigned to:None = cazfi Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/patch/?3715 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3715] Threaded AI cities generating Worker task requests
Update of patch #3715 (project freeciv): Status: In Progress = Ready For Test ___ Follow-up Comment #2: - Set want for task requests for workers to prioritize between cities As there's no fear to break threaded ai, as there really isn't distinct threaded ai yet (this patch is first to make it behave slightly different from classic which all users should still be using) I'm about to leave further improvements to future tickets. (file #17360) ___ Additional Item Attachment: File name: ThreadedCityRequests-3.patch Size:11 KB ___ Reply to this item at: http://gna.org/patch/?3715 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3715] Threaded AI cities generating Worker task requests
Follow-up Comment #1, patch #3715 (project freeciv): - Mutex protection for city existence. Now there should be no possibility of crash because of lack of mutex protection. It's possible that some data it handles is inconsistent due to main thread modifying it at the same time, but I consider this part of the nature of current threadedd ai (we're not after 100% accurate results, but fuzzy heuristics of what is likely the best action) - Evaluats road and base building tasks, assigning them only if player is able to build extras in question to the tile (file #17300) ___ Additional Item Attachment: File name: ThreadedCityRequests-2.patch Size:11 KB ___ Reply to this item at: http://gna.org/patch/?3715 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #3715] Threaded AI cities generating Worker task requests
URL: http://gna.org/patch/?3715 Summary: Threaded AI cities generating Worker task requests Project: Freeciv Submitted by: cazfi Submitted on: Mon 18 Feb 2013 04:32:04 AM EET Category: ai Priority: 5 - Normal Status: In Progress Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: 2.5.0 ___ Details: This proof-of-concept patch adds first real work to threaded AI's subthread. In the beginning of the player phase, cities evaluate potential worker tasks in their area, and send best one to the main thread to set for the city. When workers then have time, they take these tasks. This still needs a lot of work before it gives as good results as current model of settlers always looking for job themselves. - Supports only a few worker tasks, no road or base building - Assumes that any task it evaluates is possible, i.e., may request impossible tasks - Virtually no mutex protection so threads may handle the city simultaneously leading them to get inconsistent values - Does not give out values of the tasks. Worker may end working on almost-zero-value task of one city when nearby city has urgent task. - Does not care about lenght of the work, only about value of sfinished work ___ File Attachments: --- Date: Mon 18 Feb 2013 04:32:04 AM EET Name: ThreadedCityRequests.patch Size: 7kB By: cazfi http://gna.org/patch/download.php?file_id=17243 ___ Reply to this item at: http://gna.org/patch/?3715 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev