Safe Haskell | None |
---|---|
Language | Haskell2010 |
Actor preferences for targets and actions, based on actor aspects.
Synopsis
- totalUsefulness :: COps -> FactionId -> FactionDict -> ItemFull -> Benefit
- effectToBenefit :: COps -> FactionId -> FactionDict -> Effect -> (Double, Double)
- averageTurnValue :: Double
- avgItemDelay :: Double
- avgItemLife :: Double
- durabilityMult :: Double
- organBenefit :: Double -> GroupName ItemKind -> COps -> FactionId -> FactionDict -> (Double, Int)
- recBenefit :: GroupName ItemKind -> COps -> FactionId -> FactionDict -> (Double, Int)
- fakeItem :: ContentId ItemKind -> ItemKind -> KindMean -> ItemFull
- aspectToBenefit :: Aspect -> Double
- aspectRecordToBenefit :: AspectRecord -> [Double]
Documentation
totalUsefulness :: COps -> FactionId -> FactionDict -> ItemFull -> Benefit Source #
Compute the whole Benefit
structure, containing various facets
of AI item preference, for an item with the given effects and aspects.
Internal operations
effectToBenefit :: COps -> FactionId -> FactionDict -> Effect -> (Double, Double) Source #
How much AI benefits from applying the effect.
The first component is benefit when applied to self, the second
is benefit (preferably negative) when applied to enemy.
This represents benefit from using the effect every avgItemDelay
turns,
so if the item is not durable, the value is adjusted down elsewhere.
The benefit includes the drawback of having to use the actor's turn,
except when there is battle and item is a weapon and so there is usually
nothing better to do than to melee, or when the actor is stuck or idle
or laying in wait or luring an enemy from a safe distance.
So there is less than averageTurnValue
included in each benefit,
so in case when turn is not spent, e.g, periodic activation or conditions,
the difference in value is only slight.
avgItemLife :: Double Source #
organBenefit :: Double -> GroupName ItemKind -> COps -> FactionId -> FactionDict -> (Double, Int) Source #
recBenefit :: GroupName ItemKind -> COps -> FactionId -> FactionDict -> (Double, Int) Source #
aspectToBenefit :: Aspect -> Double Source #
aspectRecordToBenefit :: AspectRecord -> [Double] Source #