• Create Account

Banner advertising on our site currently available from just \$5!

### #ActualAngleWyrm

Posted 26 August 2013 - 06:43 PM

I recall a game named Children oif the Nile  (an ancient egyptian game) which had a severe problem (and lack of a competant designer/programmer aparently ) where the workers were generated by placing houses on the map which attracted immigrants which then sought available work  -- you also placed various workplaces (effectively factories) on the map to provide those jobs.     Unfortunately the workers got locked into whatever job the first assigned themselves to and would waste huge amounts of time crossing the map  (some taking all day and then walking home without doing much of a work period) when similar work positions were nearby.    New housing placed adjacent to the factory went unused or attracted workers  which also often went across the whole map to work.  There were even administrative functionals who should have had the job to organize/straighten things out  but they were just as logic-less.

When calculating where a worker should live, we start with a list of possible homes and another list of possible employers. Then we want to select the pairing of available home-work that has the shortest walking distance.

Each candidate house has a full set of the possible workplaces to travel to. So the total number of distances to consider is numHouses * numWorkplaces. For example, if the map currently has 4 home vacancies, and 3 factories that can employ people, then there are a total of 4 * 3 = 12 possible routes.

So create a PriorityQueue containing home-work associations, sorted on distance between them. Then draw the top item whenever you need to assign a worker to a home-work route.

### #6AngleWyrm

Posted 26 August 2013 - 06:42 PM

I recall a game named Children oif the Nile  (an ancient egyptian game) which had a severe problem (and lack of a competant designer/programmer aparently ) where the workers were generated by placing houses on the map which attracted immigrants which then sought available work  -- you also placed various workplaces (effectively factories) on the map to provide those jobs.     Unfortunately the workers got locked into whatever job the first assigned themselves to and would waste huge amounts of time crossing the map  (some taking all day and then walking home without doing much of a work period) when similar work positions were nearby.    New housing placed adjacent to the factory went unused or attracted workers  which also often went across the whole map to work.  There were even administrative functionals who should have had the job to organize/straighten things out  but they were just as logic-less.

When calculating where a worker should live, we start with a list of possible homes and another list of possible employers. Then we want to select the pairing of available home-work that has the shortest walking distance.

Each candidate house has a full set of the possible workplaces to travel to. So the total number of distances to consider is numHouses * numWorkplaces. For example, if the map currently has 4 home vacancies, and 3 factories that can employ people, then there are a total of 4 * 3 = 12 possible routes.

So create a PriorityQueue containing a Map of home-work associations, sorted on distance between them. Then draw the top item whenever you need to assign a worker to a home-work route.

### #5AngleWyrm

Posted 26 August 2013 - 05:04 PM

I recall a game named Children oif the Nile  (an ancient egyptian game) which had a severe problem (and lack of a competant designer/programmer aparently ) where the workers were generated by placing houses on the map which attracted immigrants which then sought available work  -- you also placed various workplaces (effectively factories) on the map to provide those jobs.     Unfortunately the workers got locked into whatever job the first assigned themselves to and would waste huge amounts of time crossing the map  (some taking all day and then walking home without doing much of a work period) when similar work positions were nearby.    New housing placed adjacent to the factory went unused or attracted workers  which also often went across the whole map to work.  There were even administrative functionals who should have had the job to organize/straighten things out  but they were just as logic-less.

When calculating where a worker should live, we start with a list of possible homes and another list of possible employers. Then we want to select the pairing of available home-work that has the shortest walking distance.

Each candidate house has a full set of the possible workplaces to travel to. So the total number of distances to consider is numHouses * numWorkplaces. For example, if the map currently has 4 home vacancies, and 3 factories that can employ people, then there are a total of 4 * 3 = 12 possible routes.

So create a PriorityQueue containing Pairs of home-work associations, sorted on distance between them. Then draw the top item whenever you need to assign a worker to a home-work route.

### #4AngleWyrm

Posted 26 August 2013 - 05:03 PM

I recall a game named Children oif the Nile  (an ancient egyptian game) which had a severe problem (and lack of a competant designer/programmer aparently ) where the workers were generated by placing houses on the map which attracted immigrants which then sought available work  -- you also placed various workplaces (effectively factories) on the map to provide those jobs.     Unfortunately the workers got locked into whatever job the first assigned themselves to and would waste huge amounts of time crossing the map  (some taking all day and then walking home without doing much of a work period) when similar work positions were nearby.    New housing placed adjacent to the factory went unused or attracted workers  which also often went across the whole map to work.  There were even administrative functionals who should have had the job to organize/straighten things out  but they were just as logic-less.

When calculating where a worker should live, we start with a list of possible employers and a list of possible homes. Then we want to select the pairing of available home-work that has the shortest walking distance.

Each candidate house has a full set of the possible workplaces to travel to. So the total number of distances to consider is numHouses * numWorkplaces. For example, if the map currently has 4 home vacancies, and 3 factories that can employ people, then there are a total of 4 * 3 = 12 possible routes.

So create a PriorityQueue containing Pairs of home-work associations, sorted on distance between them. Then draw the top item whenever you need to assign a worker to a home-work route.

### #3AngleWyrm

Posted 26 August 2013 - 05:01 PM

I recall a game named Children oif the Nile  (an ancient egyptian game) which had a severe problem (and lack of a competant designer/programmer aparently ) where the workers were generated by placing houses on the map which attracted immigrants which then sought available work  -- you also placed various workplaces (effectively factories) on the map to provide those jobs.     Unfortunately the workers got locked into whatever job the first assigned themselves to and would waste huge amounts of time crossing the map  (some taking all day and then walking home without doing much of a work period) when similar work positions were nearby.    New housing placed adjacent to the factory went unused or attracted workers  which also often went across the whole map to work.  There were even administrative functionals who should have had the job to organize/straighten things out  but they were just as logic-less.

When calculating where a worker should live, we start with a list of possible employers and a list of possible homes. Then we want to select the pairing of available home-work that has the shortest walking distance.

For every candidate house there is a full set of the possible candidate workplaces to examine. So the total number of distances to consider is numHouses * numWorkplaces. For example, if the map currently has 4 home vacancies, and 3 factories that can employ people, then there are a total of 4 * 3 = 12 possible routes.

Create a PriorityQueue containing Pairs of home-work associations, sorted on distance between them. Then draw the top item whenever you need to assign a worker to a home-work route.

### #2AngleWyrm

Posted 26 August 2013 - 04:38 PM

I recall a game named Children oif the Nile  (an ancient egyptian game) which had a severe problem (and lack of a competant designer/programmer aparently ) where the workers were generated by placing houses on the map which attracted immigrants which then sought available work  -- you also placed various workplaces (effectively factories) on the map to provide those jobs.     Unfortunately the workers got locked into whatever job the first assigned themselves to and would waste huge amounts of time crossing the map  (some taking all day and then walking home without doing much of a work period) when similar work positions were nearby.    New housing placed adjacent to the factory went unused or attracted workers  which also often went across the whole map to work.  There were even administrative functionals who should have had the job to organize/straighten things out  but they were just as logic-less.

When calculating where a worker should live, we have a list of possible employers and a list of possible homes. We want to select the pairing of available home-work that has the shortest walking distance.

For every candidate house there is a full set of the possible candidate workplaces to examine. So the total number of distances to consider is numHouses * numWorkplaces. For example, if the map currently has 4 home vacancies, and 3 factories that can employ people, then there are a total of 4 * 3 = 12 possible routes.

Create a PriorityQueue containing Pairs of home-work associations, sorted on distance between them. Then draw the top item whenever you need to assign a worker to a home-work route.

PARTNERS