Ejemplo n.º 1
0
def LErrorNaiveBinom(G, M, E):
    # possible number of edges in an undirected, non-self-connected graph of N nodes
    posNumEdges = (G.numNodes * G.numNodes - G.numNodes) / 2
    cost = LU(posNumEdges - E.numCellsExcluded,
              E.numUnmodelledErrors + E.numModellingErrors)
    if config.optVerbosity > 1: print ' - L_nb(E)', cost
    return cost
Ejemplo n.º 2
0
def LErrorTypedBinom(G, M, E):
    # possible number of edges in an undirected, non-self-connected graph of N nodes
    posNumEdges = (G.numNodes * G.numNodes - G.numNodes) / 2

    # First encode the modelling errors
    #print 'First encode the modelling errors'
    #print 'E.numCellsCovered, E.numCellsExcluded, E.numModellingErrors;'
    #print E.numCellsCovered, E.numCellsExcluded, E.numModellingErrors;
    costM = LU(E.numCellsCovered - E.numCellsExcluded, E.numModellingErrors)
    if config.optVerbosity > 1: print ' - L_tb(E+)', costM

    # Second encode the unmodelled errors
    #print 'Second encode the unmodelled errors' (excluded cells are always covered!)
    #print posNumEdges - E.numCellsCovered, E.numUnmodelledErrors;
    costU = LU(posNumEdges - E.numCellsCovered, E.numUnmodelledErrors)
    if config.optVerbosity > 1: print ' - L_tb(E-)', costU
    return costM + costU