from scipy.stats import uniform from spatiotemporal.temporal_events import RelationFormulaGeometricMean f = RelationFormulaGeometricMean() A = uniform(loc=0, scale=4) B = uniform(1, 1) C = uniform(2, 1) print 'A, B', f.compare(A, B) print 'B, C', f.compare(B, C) print 'A, C', f.compare(A, C) Bh = uniform(0, 1) # Ah = uniform(-0.95, 3.84) Ah = uniform(0, 1) print 'Ah, Bh', f.compare(Ah, Bh) Ch = uniform(1, 1) print 'Bh, Ch', f.compare(Bh, Ch) print 'Ah, Ch', f.compare(Ah, Ch)
denominator = length_a * same_a_b_ending ** 2 length_b_ending_lower_bound = (length_a * same_a_b_ending ** 2) ** 2 / denominator length_b_ending_upper_bound = (a_start_point + length_a - 1) ** 2 / denominator length_b_ending = (length_b_ending_lower_bound + length_b_ending_upper_bound) / 2.0 b_start_point = a_start_point + length_a - same_a_b_ending * sqrt(length_b_ending * length_a) b_ending = uniform(b_start_point, length_b_ending) return [a_possibility], b_ending if __name__ == '__main__': b_ending = uniform(3, 4) c = uniform(0.5, 3) rf = RelationFormulaGeometricMean() f = CombinationFormulaGeometricMeanTrapezium() r_1, r_2 = rf.compare(c, uniform_reference), rf.compare(c, b_ending) c = f._find_c_in_the_middle(r_1, r_2, b_ending) print c.args quit() from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium # f = CombinationFormulaGeometricMeanTrapezium() # rf = RelationFormulaGeometricMean() # a, b_beg, b_end = uniform(5, 2), uniform(1, 3), uniform(8, 4) # [a_h], b_end_h = f.unpack(rf.compare(a, b_beg), rf.compare(a, b_end)) # # print a_h.args, b_end_h.args # print rf.compare(a, b_beg), rf.compare(a, b_end)