Esempio n. 1
0
 def test_esmrmb_mr_stepwise_cap_sum(self):
     bl = revpy.booking_limits(self.fares,
                               self.demands,
                               cap=self.cap,
                               sigmas=self.sigmas,
                               method='EMSRb_MR_step')
     np.testing.assert_equal(bl.sum(), self.cap)
Esempio n. 2
0
 def test_esmrmb_mr_stepwise(self):
     bl = revpy.booking_limits(self.fares,
                               self.demands,
                               cap=40,
                               sigmas=self.sigmas,
                               method='EMSRb_MR_step')
     np.testing.assert_equal(bl, np.array([39., 1., 0., 0., 0., 0.]))
Esempio n. 3
0
 def test_booking_limits_esmrmb_mr(self):
     bl = revpy.booking_limits(self.fares,
                               self.demands,
                               cap=self.cap,
                               sigmas=self.sigmas,
                               method='EMSRb_MR')
     np.testing.assert_equal(np.array([35., 17., 32., 16., 0., 0.]), bl)
Esempio n. 4
0
 def test_booking_limits_esmrmb(self):
     bl = revpy.booking_limits(self.fares,
                               self.demands,
                               cap=self.cap,
                               sigmas=self.sigmas,
                               method='EMSRb')
     self.assertEqual([20., 15., 19., 26., 20., 0.], bl.tolist())
Esempio n. 5
0
 def test_esmrmb_mr_stepwise_nan_demand(self):
     demands = np.full(self.demands.shape, np.nan)
     bl = revpy.booking_limits(self.fares,
                               demands,
                               self.cap,
                               sigmas=self.sigmas,
                               method='EMSRb_MR_step')
     np.testing.assert_equal(bl, np.array([self.cap, 0., 0., 0., 0., 0.]))
Esempio n. 6
0
 def test_booking_limits_esmrmb_zero_demand(self):
     demands = np.zeros(self.demands.shape)
     bl = revpy.booking_limits(self.fares,
                               demands,
                               cap=self.cap,
                               sigmas=self.sigmas,
                               method='EMSRb')
     self.assertEqual([self.cap, 0., 0., 0., 0., 0.], bl.tolist())