Factories & Workers

Started by
15 comments, last by powerneg 10 years, 6 months ago

Workers should only switch jobs/housing when a better job/housing opportunity becomes available. Pareto efficiency. Better job = higher net profit (higher pay, less travel time). Better housing = higher net profit (cheaper, closer to work). Maybe factor in time spent shopping/eating at shopping malls/stores. So you'd have to check job/housing opportunities whenever a rent or wage changes, or a new apartment building/work place becomes constructed, or the job or home changes (requiring a check against all available jobs or housing, to pair it up with a different job/home until there's no more change).

Advertisement
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.

The the question is are there any other factors which effect the decision to make one home more desireable than another for a worker or worker differentiation which makes some better than others for a particular factory. Thus complicating your 'fitting' calculations/decision.

Another is: is it a static situation or if dynamic which can change and what will your strategy will be for recalculation . Depends how complex you simulation is as to wheter the change itself has some cost so you then have to weight which corrections cost the least but still have adaquate benefits for production (ex- in the Nile game, housing grew/developed and progressed and when a worker moved they had to start over which was a big negative cost factor , likewise transportation paths (dependant on seperate map objects) could be shifted and a workers old path might be very different from a new current shortest path)

  1. The above system used minimum walking distance as the score criteria, but you can create a utility function that weights any number of additional factors any way you please and returns a single scalar score for use in the priorityqueue. But the business of arriving at a mathematically accurate weighting for additional factors is typically...Unrefined. Often resolved by ballpark guess followed by iterative buff/nerf adjustments. Is it necessarily a refinement process, or can it be calculated? Don't know, and it could be that this is an instance where the answer can only be achieved through executing a procedure, rather than calculating an answer.
  2. The represented situation was dynamic, with buildings being constructed and demolished, with people being hired and possibly fired or killed. If people are given the option to automatically move to closer distance housing as soon as that's available, then we have a re-evaluation taking place by each citizen after construction. This re-evaluation could take the form of summing up the total distance walked by all citizens, then running a simulation where everyone is kicked and re-housed, and comparing the proposed new total distance to the old total distance. If the new score meets some threshhold criteria, then relocation happens.
--"I'm not at home right now, but" = lights on, but no ones home

Khem, you sidetracked it to too many unnecessary and unimportant technical details :) The big question is, how the player is going to control the flow of workers (if we assume that workers should select the job as they fit, since that's the direction this discussion is going for so far)?

There is a coal mine, iron ore mine and a steel foundry. How the player can "control" so these buildings have balanced workforce so as few capacity is wasted as possible? How to make it so the player worries both on funds to construct new factories and about the availability of workforce?

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

There is a coal mine, iron ore mine and a steel foundry. How the player can "control" so these buildings have balanced workforce...

More detail is required in the example, before it can generate anything more than just rolling a random dice. Once there is a perception of a goal condition, then solving for the goal condition is possible, both automatically and as an exercise for the player.

So let's say that it takes 3 coal workers to produce power for each steel foundry worker, and 2 coal worker to produce power for an iron worker, and that the steel workers also require an iron worker. And we wish to maximize the output of steel. And we have only 25 workers at the moment. How many of each type should we create? Or maybe we currently have two iron factories that can house a maximum of 8 iron workers; then how many of each type should we create? Or maybe we wonder: Should I buy more people or more factories, and if so, which kind?

This is linear algebra, and it can be entertaining.

--"I'm not at home right now, but" = lights on, but no ones home

There is a coal mine, iron ore mine and a steel foundry. How the player can "control" so these buildings have balanced workforce...

More detail is required in the example, before it can generate anything more than just rolling a random dice. Once there is a perception of a goal condition, then solving for the goal condition is possible, both automatically and as an exercise for the player.

So let's say that it takes 3 coal workers to produce power for each steel foundry worker, and 2 coal worker to produce power for an iron worker, and that the steel workers also require an iron worker. And we wish to maximize the output of steel. And we have only 25 workers at the moment. How many of each type should we create? Or maybe we currently have two iron factories that can house a maximum of 8 iron workers; then how many of each type should we create?

This is linear algebra, and it can be entertaining.

Linear alge best alge.

There is a fitting method ( for building a full ituation from scratch) where you grow the situation organicly to adhere to the limitations and practicalities.

Special setup rules define operetional requirements for the consumers (factories needing workers, and other factories needing the output of those other factories, and probably also services and materials to sustain the workers). Resoyrce limitation would be supplied as an initial input...

Entities are added one at a time and their requirements ae then met (other entities which feed their consumption) til you have a viable (if not optimal) sitution.

At some point the external limitation may be reached and you have to backtrack the non viable entities (remove or downsize) and then reapportion the freed resources to other entities (now locking the one that failed)

Some initial tagets(goals) may define the priority for the first entities ( a coal plant and a steel plant) to get the organic growth going (seeds I suppose is theright euphemism)

The growth goes around and around till everything is blocked (whats left over is in a free pool for the game start)

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

To make both equally important you could have each build something different yet dependent at the same time.

For example you 're building tanks, the factory-size determines the size(which equals higher stats) yet it does not have any armor(stat) except that the # of workerhours made in the factory while the tank was being build increase it's armor.

This way they're both important, they 're better when balanced by the player, and depending on the enemies(low rate high damage fire or high rate medium-low damage fire) this balance could mean something different every level.

There 's also civilisation that just had the spare workers turn into tax-makers/science-makers/entertainers/...

This topic is closed to new replies.

Advertisement