ContextAlgebra-0.2.0.1: Context Algebra

Maintainerhahn@geoinfo.tuwien.ac.at
Stabilitybeta
Safe HaskellNone
LanguageHaskell2010

ConceptModel

Description

This module implements the necessary functions to model a concept influenced by several contexts. The concept is represented by several exemplars. For each influencing context the exemplars have different observation frequency. The connection from exemplars and context is modeled by the data type Experience. Each Experience can be made several times where the amount is hold by a Multiset.

Synopsis

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) Source 
(Ord c, Ord e) => Ord (Experience c e) Source 
(Show c, Show e) => Show (Experience c e) Source 

type Concept 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) => ConceptContextModel c e where Source

the class defines the necessary functions needed for the context algebra

Minimal complete definition

Nothing

Methods

createConceptForContext Source

Arguments

:: (Show c, Ord c, Show e, Ord e) 
=> Context c

context in which the experiences were made

-> [e]

exemplars which are observed

-> [Int]

amount of observations for one exemplar in this context

-> Concept (Context c) e

resulting concept with the given experiences

combines the observation amount of exemplars for one context

amountExperiences Source

Arguments

:: Concept (Context c) e

concept including experinces

-> Int

amount of experiences

calculates the amount of experiences that are present for the concept

unionsConceptsForDiffContexts Source

Arguments

:: (Ord e, Ord c) 
=> [Concept (Context c) e]

list of conceptualizations holding experiences for different contexts

-> Concept (Context c) e

union of the experiences holding now all experiences for all contexts

unions the experiences stored for one concept for different contexts

filterConceptWithContext Source

Arguments

:: (Enumerable c, Enumerable (Context c), Ord e, Eq c, Ord c) 
=> Context c

context used to filter the experiences

-> Concept (Context c) e

experiences to filter

-> Concept (Context c) e

filtered experiences, more finer experiences are returned

filters a concept for a context, gets a concept for a finer context, the context c has to be more finer than the context that are included in the concept

typicalityForExemplarsInContext 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

-> Concept (Context c) e

concept with the experiences

-> [(e, Probability)]

returned distribution

returns the typicality distribution for each exemplar in the context c, the type e is only used as type parameter

typicalExemplarInContext 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

-> Concept (Context c) e

concept with the experiences

-> (e, Probability)

tupel with the highest probability value

returns the typical exemplar of a concept for the context

printConcept Source

Arguments

:: (Show e, Show c) 
=> Concept c e

experiences of the concept to print

-> IO ()

returned IO()

converts the experiences of the concept to a IO()