示例#1
0
 def getDozensLastOccurrencePerConcurso(self, nDoConc=None):
   nTotalDeConcursos = sl.getNTotalDeConcursos()
   if nDoConc == None:
     nDoConc = nTotalDeConcursos
   if nDoConc < 1 or nDoConc > nTotalDeConcursos:
     return None
   concurso = sl.getConcursoObjByN(nDoConc)
   dezenas = concurso.getDezenas(); lastDepthPerDozenDict = {}
   for dezena in dezenas:
     lastDepthPerDozenDict[dezena] = lookUpDozenLastOccurDepth(dezena, nDoConc)
   return lastDepthPerDozenDict
示例#2
0
def lookUpDozenLastOccurrenceNDoConc(dezena):
  '''
  this method may be considered 'static'
  it considers the last concurso and call lookUpDozenDepth(dezena, nDoConcWhereDezenaIs)
  
  However, one care is taken: if dezena happened in the last concurso. 0 (zero) should be returned
  '''
  concurso = sl.getConcursoObjByN() # this picks up the last concurso
  if concurso.isDezenaInConcurso(dezena):
    # if true, depth is 0, ie, dezena happened at the last concurso 
    return 0
  nTotalDeConcursos =  sl.getNTotalDeConcursos() # the same thing: = concurso['nDoConcurso']
  return lookUpDozenLastOccurDepth(dezena, nTotalDeConcursos)
示例#3
0
 def stats_lastDepthPerDozenForAllConcursos(self, printCallBack=None):
   if self.dozensLastOccurrenceForAllConcursos == None:
     self.generateDozensLastOccurrenceForAllConcursos()
   nTotalDeConcursos = sl.getNTotalDeConcursos()
   self.minDepth = 100; self.maxDepth = 0; depthHistogram = {}
   # sweep all concursos
   for nDoConc in range(1, nTotalDeConcursos+1):
     lastDepthPerDozenDict = self.dozensLastOccurrenceForAllConcursos[nDoConc - 1]
     tilIndices = self.processDezenasFor_stats_lastDepthPerDozenForAllConcursos(lastDepthPerDozenDict, depthHistogram)
     tilStats = fForFreqs.Stats1(tilIndices)
     #params = nDoConc, tilIndices, tilStats #.getHistogram()
     concurso = sl.getConcursoObjByN(nDoConc)
     print nDoConc, concurso.getDezenasPrintable(), tilStats #.getHistogram()tilIndices,
     
   print 'minDepth', self.minDepth, 'maxDepth', self.maxDepth
   '''
示例#4
0
 def generateDozensLastOccurrenceForAllConcursos(self):
   nTotalDeConcursos = sl.getNTotalDeConcursos()
   self.dozensLastOccurrenceForAllConcursos = []
   for nDoConc in range(1, nTotalDeConcursos+1):
     lastDepthPerDozenDict = self.getDozensLastOccurrencePerConcurso(nDoConc)
     self.dozensLastOccurrenceForAllConcursos.append(lastDepthPerDozenDict)
示例#5
0
 def print_allDezenasDepthRow(self):
   lastNDoConc = sl.getNTotalDeConcursos()
   print self.dozensLastOccurrenceForAllConcursos[lastNDoConc - 1]
示例#6
0
 def print_lastDepthPerDozenForAllConcursos(self):
   if self.dozensLastOccurrenceForAllConcursos == None:
     self.generateDozensLastOccurrenceForAllConcursos()
   nTotalDeConcursos = sl.getNTotalDeConcursos()
   for nDoConc in range(1, nTotalDeConcursos+1):
     self.print_lastDepthPerDozen(nDoConc)