Esempio n. 1
0
    def generalConf(self):
        objL = []
        objL.append(HtmlTag('h2', 'General parameters'))
        rowL = []
        rowL.append([Bold('Match duration'), formatDelay(self.config.matchDuration * 60.)])
        rowL.append([Bold('Number of match'), str(self.config.nMatch)])
        rowL.append([Bold('Double match penalty'), "%.3g" % (self.config.penDateFactor)])

        objL.append(HtmlTable(rowL, [{'align': 'left'}, {'align': 'left'}], **{'class': 'table table-bordered'}))
        return objL
Esempio n. 2
0
    def __html__(self):
        maxTime = self.v2p.maxTime
        endTime = maxTime + self.startTime
        elapsedTime = t.time() - self.startTime
        timeLeft = endTime - t.time()
        percentDone = 100.*(maxTime-timeLeft)/maxTime
        strL = []
        strL.append( "started at %s for %s, ending at %s"%(
            formatTime( self.startTime ), formatDelay( maxTime ), formatTime( endTime ) ) )
        if self.finished:
            strL.append( 'Optimization finished.')
            strL.append( '%d schedules explored.'%self.v2p.i)
        else:
            barStr = """<table width="50%%" height="10" cellspacing="0"><tr><td width="%f%%" bgcolor="green"></td><td bgcolor="#AAAAAA"></td></tr> </table>"""
#            strL.append("Shaking it really hard baby !!!")
            strL.append( "%s left (%d%% done and %d schedules explored)"%( formatDelay( timeLeft ), percentDone, self.v2p.i) )
            strL.append(  barStr%( max(1,percentDone) )  )
#            strL.append( "Current speed : %.1f schedule / s "% (self.speed) )
            strL.append( 'average speed : %.1f schedule / s'%(float(self.v2p.i) / elapsedTime ) )
            strL.append( 'Temperature %.3g (%.3g ... %.3g)'%(self.v2p.T, self.v2p.T0, self.v2p.Tend ) )
        return "<br/>\n".join( strL )
Esempio n. 3
0
 def __html__(self):
     maxTime = self.v2p.maxTime
     endTime = maxTime + self.startTime
     elapsedTime = t.time() - self.startTime
     timeLeft = endTime - t.time()
     percentDone = 100. * (maxTime - timeLeft) / maxTime
     strL = []
     strL.append("started at %s for %s, ending at %s" % (formatTime(
         self.startTime), formatDelay(maxTime), formatTime(endTime)))
     if self.finished:
         strL.append('Optimization finished.')
         strL.append('%d schedules explored.' % self.v2p.i)
     else:
         barStr = """<table width="50%%" height="10" cellspacing="0"><tr><td width="%f%%" bgcolor="green"></td><td bgcolor="#AAAAAA"></td></tr> </table>"""
         #            strL.append("Shaking it really hard baby !!!")
         strL.append("%s left (%d%% done and %d schedules explored)" %
                     (formatDelay(timeLeft), percentDone, self.v2p.i))
         strL.append(barStr % (max(1, percentDone)))
         #            strL.append( "Current speed : %.1f schedule / s "% (self.speed) )
         strL.append('average speed : %.1f schedule / s' %
                     (float(self.v2p.i) / elapsedTime))
         strL.append('Temperature %.3g (%.3g ... %.3g)' %
                     (self.v2p.T, self.v2p.T0, self.v2p.Tend))
     return "<br/>\n".join(strL)
Esempio n. 4
0
    def _buildHtml(self):
        self.objL = []
        self.objL.append(HtmlTag('h2', 'Team group conflicts'))

        conflictInfoTable = {}
        colL = ['nb conflicts', 'nb overlap', 'avg time gap', 'cum penalty']
        penRowL = []
        for grpId, conflictL in self.teamGrpConflictD.items():
            (mag, _teamL) = self.config.grpD[grpId]
            dtL = []
            conflictCount = 0
            negDtL = []
            cumPen = 0
            for conflict, _matchA, _matchB in conflictL:
                if conflict.hasConflict():
                    conflictCount += 1
                elif conflict.dt < 0:
                    negDtL.append(conflict.dt)
                else:
                    dtL.append(conflict.dt)
                cumPen += mag * conflict.penRatio

            if len(dtL) == 0:
                waitingTime = 0
            else:
                waitingTime = float(sum(dtL)) / len(dtL)

            conflictInfoTable[(grpId, colL[0])] = conflictCount
            conflictInfoTable[(grpId, colL[1])] = len(negDtL)
            conflictInfoTable[(grpId, colL[2])] = formatDelay(waitingTime * 60)
            conflictInfoTable[(grpId, colL[3])] = cumPen
            penRowL.append((cumPen, grpId))

        penRowL.sort(reverse=True)
        rowL = [grpId for _pen, grpId in penRowL]
        self.objL.append(
            HtmlTableMap(
                {
                    "cellpadding": "5",
                    "cellspacing": "0",
                    'class': 'table table-bordered'
                },
                conflictInfoTable,
                rowL=rowL,
                colL=colL))
Esempio n. 5
0
    def generalConf(self):
        objL = []
        objL.append(HtmlTag('h2', 'General parameters'))
        rowL = []
        rowL.append([
            Bold('Match duration'),
            formatDelay(self.config.matchDuration * 60.)
        ])
        rowL.append([Bold('Number of match'), str(self.config.nMatch)])
        rowL.append([
            Bold('Double match penalty'),
            "%.3g" % (self.config.penDateFactor)
        ])

        objL.append(
            HtmlTable(rowL, [{
                'align': 'left'
            }, {
                'align': 'left'
            }], **{'class': 'table table-bordered'}))
        return objL
Esempio n. 6
0
    def _buildHtml(self):
        self.objL = []
        self.objL.append(HtmlTag('h2', 'Team group conflicts'))

        conflictInfoTable = {}
        colL = ['nb conflicts', 'nb overlap', 'avg time gap', 'cum penalty']
        penRowL = []
        for grpId, conflictL in self.teamGrpConflictD.items():
            (mag, _teamL) = self.config.grpD[grpId]
            dtL = []
            conflictCount = 0
            negDtL = []
            cumPen = 0
            for conflict, _matchA, _matchB in conflictL:
                if conflict.hasConflict():
                    conflictCount += 1
                elif conflict.dt < 0:
                    negDtL.append(conflict.dt)
                else:
                    dtL.append(conflict.dt)
                cumPen += mag * conflict.penRatio

            if len(dtL) == 0:
                waitingTime = 0
            else:
                waitingTime = float(sum(dtL))/len(dtL)

            conflictInfoTable[(grpId, colL[0])] = conflictCount
            conflictInfoTable[(grpId, colL[1])] = len(negDtL)
            conflictInfoTable[(grpId, colL[2])] = formatDelay(waitingTime * 60)
            conflictInfoTable[(grpId, colL[3])] = cumPen
            penRowL.append((cumPen, grpId))

        penRowL.sort(reverse=True)
        rowL = [grpId for _pen, grpId in penRowL]
        self.objL.append(HtmlTableMap({"cellpadding": "5", "cellspacing": "0", 'class': 'table table-bordered'}, conflictInfoTable, rowL=rowL, colL=colL))