patchFreeciv - Patches: patch #3715, Threaded AI cities generating...

 
 
Show feedback again

patch #3715: Threaded AI cities generating Worker task requests

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Mon 18 Feb 2013 02:32:04 AM UTC  
 
Category: aiPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 26 Mar 2013 01:53:29 AM UTC, comment #6:

I committed my warning workaround, since no better ideas were suggested and it stops me building.

Jacob Nevins <jtn>
Project Administrator
Tue 26 Mar 2013 01:51:24 AM UTC, SVN revision 22599:

Work around 'may be used uninitialized' warnings post patch #3715.

(Browse SVN revision 22599)

Jacob Nevins <jtn>
Project Administrator
Sat 23 Mar 2013 08:23:35 PM UTC, comment #4:

Unfortunately this is giving warnings for me (GCC 4.4.3-4ubuntu5.1 on Ubuntu 10.04):

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)

Jacob Nevins <jtn>
Project Administrator
Fri 08 Mar 2013 03:53:45 AM UTC, SVN revision 22496:

Threaded AI cities create worker task requests for autosettlers
to fulfill.

See patch #3715

(Browse SVN revision 22496)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 27 Feb 2013 08:40:14 AM UTC, 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)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 21 Feb 2013 07:37:43 AM UTC, comment #1:

- 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)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 18 Feb 2013 02:32:04 AM UTC, original submission:

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

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17525:  trunk-taicity-worker-task-init.patch added by jtn (785B - text/x-diff - trunk r22533: work around 'may be used uninitialized' warnings)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtn (Updated the item)
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 23 Mar 2013 08:23:35 PM UTCjtnAttached File-=>Added trunk-taicity-worker-task-init.patch, #17525
    Fri 08 Mar 2013 03:53:55 AM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Wed 27 Feb 2013 08:40:14 AM UTCcazfiAttached File-=>Added ThreadedCityRequests-3.patch, #17360
      StatusIn Progress=>Ready For Test
    Thu 21 Feb 2013 07:37:43 AM UTCcazfiAttached File-=>Added ThreadedCityRequests-2.patch, #17300
    Mon 18 Feb 2013 02:32:04 AM UTCcazfiAttached File-=>Added ThreadedCityRequests.patch, #17243
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup