Re: Ritual/site searching questions
This is the site searcing algorithim I'd use. I doesn't check strategic considerations because that's hard. It also doesn't factor that existing searches in other paths improve the odds because I've forgotten the proof that it does.
I've used variables instead of numbers so numberOfPaths = 9 (including Holy), maxSlots = 4 etc. and if the rest isn't obvious then I haven't done it right:
for i = 1 to provinces
if provinceControl(i) = player then
for j = 1 to numberOfPaths
if searchingLevel(j) > 0 then
searchedLevel = withDeclaredSearchers(i, player)
if searchingLevel(j) > searchedLevel then
slotvalue = 0
for k = 1 to (maxSlots - knownSites)
slotValue = slotValue + (baseChance + terrainChance)^j * (searchingLevel - searchedLevel)
next k
endif
endif
searchValue(i) = searchValue(i) + slotValue
next j
endif
next i
Then search the most valuable province.
|