i had an idea for how to calculate preferences into role calculations... so now the optimizer versions gonna be delayed a bit pending splinterz mastermind working on adding preference calculations.
hehe. i had an idea to group the preferences into their sub categories such as material or item.
splinterz says its a lot of work for such a small addition of happy thoughts.
something beneficial will result though
Update:
Okay, Splinterz and I came up with a great easy way to do this that allows for accurate results.
A preference ratio system that converts to a %.
Example:
Palm: 2
Beds: 1
Chairs: 1
If a Dwarf has a preference of Palm wood, then he has 2 / (2 + 1 + 1) = 50% rating for preferences.
The above example gives a 1:1 ratio of material:item types.
I guess I'll use a / for annotating type differences...
if I wanted to add more tree types and keep the ratio intact, I would merely do this
Cedar: 1 Palm: 1 / Beds: 1 Chairs: 1
So if I had another item type I'd like to add...
Cedar: 1.5 Palm: 1.5 / Beds: 1 Chairs: 1 Doors: 1
so now I have a 3 / 3 (i.e material/item) type ratio.
If I wanted to increase the weight of the materials, I could get a 2 / 1 ratio by doing the following
Cedar: 3 Palm: 3 / Beds: 1 Chairs: 1 Doors: 1
The resulting matches will be added together, and divided by the sum of all possible (above example for Cedar would be 3 / (3 + 3 + 1 + 1 + 1) = 33%
will be added into the rest of the categories (attributes, skills, traits), average will be reported to Dwarf Therapist
UPDATE:
on second thought, this awesome idea might not work out so well.
It will always produce in lower % for the preference rating for roles that have a complete listing of all items and materials... which means no direct comparison between roles that do not have preferences holding them back.
So... instead Splinterz is thinking it's best to just add a small # to the current raw % if a preference is found, which is not statistical at all, but it's the only good idea we can think of.
Update:
not sure what direction Splinterz is working on, but I had this discussion with him. (paraphrased to another person)
we're thinking of a diminishing return straight additive bonus.
it's kind of complicated, but works like my bud said, first is 5%, second preference is 7.5%, 3rd is 8.75%
however, each diminishing return can have a different value, default is half the original if the value set by user is 1, but the user can set different values...
so yeah, kind of hard to explain.
The logic though is that multiple preferences affecting a role only really make a dwarf happy to do that job, and have a chance at producing masterwork items.
producing masterwork is a skill ability, so should it outweigh skills? A high skill in carpentry will always produce masterwork items.
happiness is also contributed by traits (such as patience).
So... preferences are a two for one deal, but not as powerful as the quantifiable statistics like traits, and skills.