| Maintainer | hahn@geoinfo.tuwien.ac.at |
|---|---|
| Stability | beta |
| Safe Haskell | None |
| Language | Haskell2010 |
Model
Description
This module implements the necessary functions to model a concept and the context influence. The concept is represented by several exemplars. For each influencing context the exemplars have different observation frequency. This conncetion is modeled here by a multiset.
- data Experience c e = Exp c e
- type Experiences c e = MultiSet (Experience c e)
- type Probability = Float
- class (Ord c, Ord e, Show c, Show e) => InterpretationModel c e
- createExperiencesForContext :: (Show c, Ord c, Show e, Ord e) => c -> [e] -> [Int] -> Experiences c e
- manyfoldExperiences :: (Ord c, Show c, Ord e, Show e) => Experience c e -> Occur -> Experiences c e
- amountExperiences :: Experiences (Context c) e -> Int
- lambda :: (Enumerable c, Enumerable (Context c), Ord e, Eq c, Ord c) => Context c -> Experiences (Context c) e -> Experiences (Context c) e
- mu :: (Enumerable c, Enumerable (Context c), Ord e, Ord c) => Experience (Context c) e -> Experiences (Context c) e -> Probability
- filterExemplars :: (Ord c, Ord e) => e -> Experiences c e -> Experiences c e
- probAllExemplars4Context :: (Ord c, Ord e, Enum e, Bounded e, Enumerable c, Enumerable (Context c)) => Context c -> e -> Experiences (Context c) e -> [(e, Probability)]
- getMostProbableExemplar :: Ord e => [(e, Probability)] -> (e, Probability)
- printExperiences :: (Show e, Show c) => Experiences c e -> IO ()
- addExperience :: (Ord c, Ord e) => Experience c e -> Experiences c e -> Experiences c e
Documentation
data Experience c e Source
Each experience is formed by a exemplar of type e and a context c this exemplar was observed at.
Constructors
| Exp c e | constructor; establishes an experience from a context and an exemplar |
Instances
| (Eq c, Eq e) => Eq (Experience c e) | |
| (Ord c, Ord e) => Ord (Experience c e) | |
| (Show c, Show e) => Show (Experience c e) |
type Experiences c e = MultiSet (Experience c e) Source
All experiences are hold in a multiset
type Probability = Float Source
type synonym for better readability
class (Ord c, Ord e, Show c, Show e) => InterpretationModel c e Source
the class defines the necessary functions needed for the context algebra
createExperiencesForContext Source
Arguments
| :: (Show c, Ord c, Show e, Ord e) | |
| => c | context in which the experiences were made |
| -> [e] | exemplars which are observed |
| -> [Int] | amount of observations for one exemplar in this context |
| -> Experiences c e | resulting experience type |
combines the observation amount of exemplars for one context
Arguments
| :: (Ord c, Show c, Ord e, Show e) | |
| => Experience c e | experience that is observed several times |
| -> Occur | amount of observations of the experience |
| -> Experiences c e | experiences with the given amount and type |
If an experience is made several times the amount can be specified by the amount
Arguments
| :: Experiences (Context c) e | experinces to be counted |
| -> Int | amount of experiences |
calculates the amount of experiences that are present
Arguments
| :: (Enumerable c, Enumerable (Context c), Ord e, Eq c, Ord c) | |
| => Context c | context used to filter the experiences |
| -> Experiences (Context c) e | experiences to filter |
| -> Experiences (Context c) e | filtered experiences, more finer experiences are returned |
filters experiences for a context, gets experiences for a finer context, the context c has to be more finer than the context that are included in the experiences
Arguments
| :: (Enumerable c, Enumerable (Context c), Ord e, Ord c) | |
| => Experience (Context c) e | exemplar and context to look for |
| -> Experiences (Context c) e | experiences that are considered |
| -> Probability | probability of the exemplar in this context for the given experiences |
returns a probability of an exemplar observed in a context for the given experiences
Arguments
| :: (Ord c, Ord e) | |
| => e | exemplar used to filter the experiences |
| -> Experiences c e | experiences that are filtered |
| -> Experiences c e | experiences including values for the exemplar e |
returns experiences for the exemplar given in the first argument e
in quantum mechanics called projector
functions to print and export
probAllExemplars4Context Source
Arguments
| :: (Ord c, Ord e, Enum e, Bounded e, Enumerable c, Enumerable (Context c)) | |
| => Context c | context the distribution is made for |
| -> e | exemplar type, used as type parameter |
| -> Experiences (Context c) e | experiences the distribution is made of |
| -> [(e, Probability)] | returned distribution |
returns the observation distribution for the context c, the type e is only used as type parameter
getMostProbableExemplar Source
Arguments
| :: Ord e | |
| => [(e, Probability)] | list of tupels of Exemplars and the probability value |
| -> (e, Probability) | tupel with the highest probability value |
returns the most probable exemplar given by the list of tuples of (Exemplar, Probability)
Arguments
| :: (Show e, Show c) | |
| => Experiences c e | experience to convert to IO |
| -> IO () | returned IO() |
converts the experiences type to a IO()
functions for further development of the model
Arguments
| :: (Ord c, Ord e) | |
| => Experience c e | new experience to add |
| -> Experiences c e | given experiences where to add the new experience |
| -> Experiences c e | resulting experiences including the new and the given experiences |
adds the new experience to the given experiences