コード例 #1
0
ファイル: ran_test.py プロジェクト: snikhil0/ransm
    def testRelationTemperature(self):
        const = Containers()
        const.WAY_LENGTH_MAP[90088573] = 1
        const.WAY_LENGTH_MAP[90088567] = 2

        relationEntity = RelationEntity(const)
        relationEntity.analyze(relations)
        self.assertEqual(self.ran.relation_temperature(relationEntity, intersections), 68)
        intersections[1044247388] = 2
        self.assertEqual(self.ran.relation_temperature(relationEntity, intersections), 34)
コード例 #2
0
ファイル: entity_test.py プロジェクト: snikhil0/ransm
    def testRelationEntity(self):
        constant = Containers()
        constant.WAY_LENGTH_MAP[90088573] = 1
        constant.WAY_LENGTH_MAP[90088567] = 2

        relationEntity = RelationEntity(constant)
        relationEntity.analyze(relations)

        self.assertEquals(relationEntity.entity_count, 2)
        self.assertEqual(relationEntity.num_turnrestrcitions, 1)
        self.assertEqual(relationEntity.sum_restriction_length, 4)
        self.assertEqual(relationEntity.sum_turn_restriction_length, 3)