Beispiel #1
0
def finishesFormula(dist1, dist2):
#a+ = b+ and b- < a-
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    print size_beg_1
    print size_beg_2
    print size_end_1
    print size_end_2

    return normalize(min(((size_end_1 + size_end_2) - abs(com_end_1[0] - com_end_2[0]))
                         / (size_end_1 + size_end_2),
                         (com_beg_1[0] - com_beg_2[0]) / (size_beg_1 + size_beg_2)))
Beispiel #2
0
def startsFormula(dist1, dist2):
#a- = b- and a+ < b+
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    print("Beg1: {0}, end1: {1}".format(beg_1, end_1))
    print("Beg2: {0}, end2: {1}".format(beg_2, end_2))
    print("{0}, {1}".format(dist1, dist2))
    print(size_beg_1 + size_beg_2)
    print(size_end_2 + size_end_1)

    return normalize(min(((size_beg_1 + size_beg_2) - abs(com_beg_1[0] - com_beg_2[0]))
                         / (size_beg_1 + size_beg_2),
                         (com_end_2[0] - com_end_1[0]) / (size_end_2 + size_end_1)))
Beispiel #3
0
def finishesFormula(dist1, dist2):
    #a+ = b+ and b- < a-
    beg_1 = temporal_interval_handling.getBeginning(dist1)
    end_1 = temporal_interval_handling.getEnding(dist1)
    beg_2 = temporal_interval_handling.getBeginning(dist2)
    end_2 = temporal_interval_handling.getEnding(dist2)

    com_beg_1 = temporal_interval_handling.calculateCenterMass(beg_1)
    com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
    com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)
    com_end_2 = temporal_interval_handling.calculateCenterMass(end_2)

    size_beg_1 = temporal_interval_handling.getSize(beg_1)
    size_end_1 = temporal_interval_handling.getSize(end_1)
    size_beg_2 = temporal_interval_handling.getSize(beg_2)
    size_end_2 = temporal_interval_handling.getSize(end_2)

    print size_beg_1
    print size_beg_2
    print size_end_1
    print size_end_2

    return temporal_interval_handling.normalize(
        min(((size_end_1 + size_end_2) - abs(com_end_1[0] - com_end_2[0])) /
            (size_end_1 + size_end_2),
            (com_beg_1[0] - com_beg_2[0]) / (size_beg_1 + size_beg_2)))
Beispiel #4
0
def startsFormula(dist1, dist2):
    #a- = b- and a+ < b+
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    print("Beg1: {0}, end1: {1}".format(beg_1, end_1))
    print("Beg2: {0}, end2: {1}".format(beg_2, end_2))
    print("{0}, {1}".format(dist1, dist2))
    print(size_beg_1 + size_beg_2)
    print(size_end_2 + size_end_1)

    return normalize(
        min(((size_beg_1 + size_beg_2) - abs(com_beg_1[0] - com_beg_2[0])) /
            (size_beg_1 + size_beg_2),
            (com_end_2[0] - com_end_1[0]) / (size_end_2 + size_end_1)))
Beispiel #5
0
def	meetsFormula(dist1,dist2):
#a+ = b-
  end_1 = temporal_interval_handling.getEnding(dist1)
  beg_2 = temporal_interval_handling.getBeginning(dist2)

  com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
  com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)
  
  size_end_1 = temporal_interval_handling.getSize(end_1)
  size_beg_2 = temporal_interval_handling.getSize(beg_2)
  
  return temporal_interval_handling.normalize( ((size_end_1 + size_beg_2) - abs(com_end_1[0] - com_beg_2[0] )) / (size_end_1 + size_beg_2) )
Beispiel #6
0
def meetsFormula(dist1, dist2):
#a+ = b-
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)

    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)

    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)

    return normalize(((size_end_1 + size_beg_2) - abs(com_end_1[0] - com_beg_2[0]))
                     / (size_end_1 + size_beg_2))
Beispiel #7
0
def	beforeFormula(dist1,dist2):
#a+ < b-
  end_1 = temporal_interval_handling.getEnding(dist1)
  beg_2 = temporal_interval_handling.getBeginning(dist2)

  com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
  com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)
  
  size_end_1 = temporal_interval_handling.getSize(end_1)
  size_beg_2 = temporal_interval_handling.getSize(beg_2)
  
  #return com_end_1 < com_beg_2
  return temporal_interval_handling.normalize( (com_beg_2[0] - com_end_1[0]) / (size_end_1+size_beg_2) )
Beispiel #8
0
def beforeFormula(dist1, dist2):
    #a+ < b-
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)

    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)

    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)

    #return com_end_1 < com_beg_2
    return normalize((com_beg_2[0] - com_end_1[0]) / (size_end_1 + size_beg_2))
Beispiel #9
0
def beforeFormula(dist1, dist2):
#a+ < b-
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)

    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)

    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)

    #return com_end_1 < com_beg_2
    return normalize((com_beg_2[0] - com_end_1[0]) / (size_end_1 + size_beg_2))
Beispiel #10
0
def meetsFormula(dist1, dist2):
    #a+ = b-
    end_1 = temporal_interval_handling.getEnding(dist1)
    beg_2 = temporal_interval_handling.getBeginning(dist2)

    com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
    com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)

    size_end_1 = temporal_interval_handling.getSize(end_1)
    size_beg_2 = temporal_interval_handling.getSize(beg_2)

    return temporal_interval_handling.normalize(
        ((size_end_1 + size_beg_2) - abs(com_end_1[0] - com_beg_2[0])) /
        (size_end_1 + size_beg_2))
Beispiel #11
0
def beforeFormula(dist1, dist2):
    #a+ < b-
    end_1 = temporal_interval_handling.getEnding(dist1)
    beg_2 = temporal_interval_handling.getBeginning(dist2)

    com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
    com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)

    size_end_1 = temporal_interval_handling.getSize(end_1)
    size_beg_2 = temporal_interval_handling.getSize(beg_2)

    #return com_end_1 < com_beg_2
    return temporal_interval_handling.normalize(
        (com_beg_2[0] - com_end_1[0]) / (size_end_1 + size_beg_2))
Beispiel #12
0
def meetsFormula(dist1, dist2):
    #a+ = b-
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)

    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)

    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)

    return normalize(
        ((size_end_1 + size_beg_2) - abs(com_end_1[0] - com_beg_2[0])) /
        (size_end_1 + size_beg_2))
Beispiel #13
0
def	duringFormula(dist1,dist2):
#b- < a- and a+ < b+
  beg_1 = temporal_interval_handling.getBeginning(dist1)
  end_1 = temporal_interval_handling.getEnding(dist1)
  beg_2 = temporal_interval_handling.getBeginning(dist2)
  end_2 = temporal_interval_handling.getEnding(dist2)
  
  com_beg_1 = temporal_interval_handling.calculateCenterMass(beg_1)
  com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
  com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)
  com_end_2 = temporal_interval_handling.calculateCenterMass(end_2)

  size_beg_1 = temporal_interval_handling.getSize(beg_1)
  size_end_1 = temporal_interval_handling.getSize(end_1)
  size_beg_2 = temporal_interval_handling.getSize(beg_2)
  size_end_2 = temporal_interval_handling.getSize(end_2)
  
  return temporal_interval_handling.normalize( min((com_beg_1[0] - com_beg_2[0]) / (size_beg_1 + size_beg_2) , (com_end_2[0] - com_end_1[0]) / (size_end_2 + size_end_1)) )
Beispiel #14
0
def overlapsFormula(dist1, dist2):
#a- < b- and b- < a+ and a+ < b+
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    return normalize(min((com_beg_2[0] - com_beg_1[0]) / (size_beg_2 + size_beg_1),
                         (com_end_1[0] - com_beg_2[0]) / (size_end_1 + size_beg_2),
                         (com_end_2[0] - com_end_1[0]) / (size_end_2 + size_end_1)))
Beispiel #15
0
def duringFormula(dist1, dist2):
    #b- < a- and a+ < b+
    beg_1 = temporal_interval_handling.getBeginning(dist1)
    end_1 = temporal_interval_handling.getEnding(dist1)
    beg_2 = temporal_interval_handling.getBeginning(dist2)
    end_2 = temporal_interval_handling.getEnding(dist2)

    com_beg_1 = temporal_interval_handling.calculateCenterMass(beg_1)
    com_end_1 = temporal_interval_handling.calculateCenterMass(end_1)
    com_beg_2 = temporal_interval_handling.calculateCenterMass(beg_2)
    com_end_2 = temporal_interval_handling.calculateCenterMass(end_2)

    size_beg_1 = temporal_interval_handling.getSize(beg_1)
    size_end_1 = temporal_interval_handling.getSize(end_1)
    size_beg_2 = temporal_interval_handling.getSize(beg_2)
    size_end_2 = temporal_interval_handling.getSize(end_2)

    return temporal_interval_handling.normalize(
        min((com_beg_1[0] - com_beg_2[0]) / (size_beg_1 + size_beg_2),
            (com_end_2[0] - com_end_1[0]) / (size_end_2 + size_end_1)))
Beispiel #16
0
def equalsFormula(dist1, dist2):
#a- = b- and a+ = b+
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    return normalize(
        min(((size_beg_1 + size_beg_2) - abs(com_beg_1[0] - com_beg_2[0])) / (size_beg_1 + size_beg_2),
            ((size_end_1 + size_end_2) - abs(com_end_1[0] - com_end_2[0])) / (size_end_1 + size_end_2)))
Beispiel #17
0
def overlapsFormula(dist1, dist2):
    #a- < b- and b- < a+ and a+ < b+
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    return normalize(
        min((com_beg_2[0] - com_beg_1[0]) / (size_beg_2 + size_beg_1),
            (com_end_1[0] - com_beg_2[0]) / (size_end_1 + size_beg_2),
            (com_end_2[0] - com_end_1[0]) / (size_end_2 + size_end_1)))
Beispiel #18
0
def equalsFormula(dist1, dist2):
    #a- = b- and a+ = b+
    beg_1 = getBeginning(dist1)
    end_1 = getEnding(dist1)
    beg_2 = getBeginning(dist2)
    end_2 = getEnding(dist2)

    com_beg_1 = calculateCenterMass(beg_1)
    com_end_1 = calculateCenterMass(end_1)
    com_beg_2 = calculateCenterMass(beg_2)
    com_end_2 = calculateCenterMass(end_2)

    size_beg_1 = getSize(beg_1)
    size_end_1 = getSize(end_1)
    size_beg_2 = getSize(beg_2)
    size_end_2 = getSize(end_2)

    return normalize(
        min(((size_beg_1 + size_beg_2) - abs(com_beg_1[0] - com_beg_2[0])) /
            (size_beg_1 + size_beg_2),
            ((size_end_1 + size_end_2) - abs(com_end_1[0] - com_end_2[0])) /
            (size_end_1 + size_end_2)))