Example #1
0
    def test_init_method(self):
        n = ciw.ExitNode(100)
        self.assertEqual(n.id_number, -1)
        self.assertEqual(n.individuals, [])
        self.assertEqual(n.next_event_date, 100)
        self.assertEqual(n.node_capacity, 'Inf')

        n = ciw.ExitNode('Inf')
        self.assertEqual(n.id_number, -1)
        self.assertEqual(n.individuals, [])
        self.assertEqual(n.next_event_date, 'Inf')
        self.assertEqual(n.node_capacity, 'Inf')
Example #2
0
    def test_init_method(self):
        n = ciw.ExitNode()
        self.assertEqual(n.id_number, -1)
        self.assertEqual(n.all_individuals, [])
        self.assertEqual(n.next_event_date, float('inf'))
        self.assertEqual(n.node_capacity, float('inf'))

        n = ciw.ExitNode()
        self.assertEqual(n.id_number, -1)
        self.assertEqual(n.all_individuals, [])
        self.assertEqual(n.next_event_date, float('inf'))
        self.assertEqual(n.node_capacity, float('inf'))
Example #3
0
 def test_accept_method(self):
     n = ciw.ExitNode(200)
     i1 = ciw.Individual(3)
     i2 = ciw.Individual(8)
     self.assertEqual(n.individuals, [])
     n.accept(i1, 42.1)
     self.assertEqual(n.individuals, [i1])
     n.accept(i2, 51.8)
     self.assertEqual(n.individuals, [i1, i2])
Example #4
0
 def test_accept_method(self):
     n = ciw.ExitNode()
     i1 = ciw.Individual(3)
     i2 = ciw.Individual(8)
     self.assertEqual(n.all_individuals, [])
     n.accept(i1)
     self.assertEqual(n.all_individuals, [i1])
     n.accept(i2)
     self.assertEqual(n.all_individuals, [i1, i2])
Example #5
0
    def test_repr_method(self):
        n = ciw.ExitNode(500)
        self.assertEqual(str(n), 'Exit Node')

        n = ciw.ExitNode(2500)
        self.assertEqual(str(n), 'Exit Node')