Esempio n. 1
0
File: tlea.py Progetto: krrepo/lea
 def __init__(self, op, lea1, nTimes=2):
     Lea.__init__(self)
     self._op = op
     self._lea1 = lea1
     self._nTimes = nTimes
     if nTimes <= 0:
         raise Lea.Error("times method requires a strictly positive integer")
Esempio n. 2
0
File: plea.py Progetto: krrepo/lea
 def __init__(self,lea1,nTimes=2):
     Lea.__init__(self)
     self._lea1 = lea1
     self._lea1Tuple = lea1.map(lambda v: (v,))
     self._nTimes = nTimes
     if nTimes <= 0:
         raise Lea.Error("cprodTimes method requires a strictly positive integer")
Esempio n. 3
0
File: blea.py Progetto: krrepo/lea
 def __init__(self,*iLeas):
     Lea.__init__(self)
     self._iLeas = tuple(iLeas)
     # the following treatment is needed only if some clauses miss variables present 
     # in other clauses (e.g. CPT with context-specific independence)
     # a rebalancing is needed if there are such missing variables and if these admit multiple
     # values (total probability weight > 1)
     aleaLeavesSet = frozenset(aleaLeaf for ilea in iLeas                       \
                                        for aleaLeaf in ilea.getAleaLeavesSet() \
                                        if aleaLeaf._count > 1                  )
     self._ctxClea = Clea(*aleaLeavesSet)
Esempio n. 4
0
File: ilea.py Progetto: krrepo/lea
 def __init__(self,lea1,condLea):
     Lea.__init__(self)
     self._lea1 = lea1
     self._condLea = condLea
Esempio n. 5
0
File: clea.py Progetto: krrepo/lea
 def __init__(self,*args):
     Lea.__init__(self)
     self._leaArgs = tuple(Lea.coerce(arg) for arg in args)
Esempio n. 6
0
File: mlea.py Progetto: krrepo/lea
 def __init__(self, *args):
     Lea.__init__(self)
     self._leaArgs = tuple(Lea.coerce(arg) for arg in args)
     counts = tuple(leaArg.getAlea()._count for leaArg in self._leaArgs)
     lcm = calcLCM(counts)
     self._factors = tuple(lcm // count for count in counts)
Esempio n. 7
0
File: flea.py Progetto: krrepo/lea
 def __init__(self,f,cleaArgs):
     Lea.__init__(self)
     self._f = f
     self._cleaArgs = cleaArgs
Esempio n. 8
0
File: dlea.py Progetto: krrepo/lea
 def __init__(self,lea1,nbValues):
     if nbValues <= 0:
         raise Lea.Error("draw method requires a strictly positive integer")
     Lea.__init__(self)
     self._lea1 = lea1
     self._nbValues = nbValues