Ejemplo n.º 1
0
 def characteristic_time(self):
     """
     Tests characteristic_time determination.
     """
     # Singular event
     e = myokit.ProtocolEvent(1, 100, 0.5, 0, 0)
     self.assertEqual(e.characteristic_time(), 100.5)
     # Finite event
     e = myokit.ProtocolEvent(1, 100, 0.5, 1000, 3)
     self.assertEqual(e.characteristic_time(), 3100)
     # Indefinite event
     e = myokit.ProtocolEvent(1, 100, 0.5, 1000, 0)
     self.assertEqual(e.characteristic_time(), 1000)
     # Delayed indefinite event
     e = myokit.ProtocolEvent(1, 900, 200, 1000, 0)
     self.assertEqual(e.characteristic_time(), 1900)
     # Test protocols
     # Singular event
     p = myokit.Protocol()
     p.schedule(1, 100, 0.5, 0, 0)
     self.assertEqual(p.characteristic_time(), 100.5)
     # Finite event
     p = myokit.Protocol()
     p.schedule(1, 100, 0.5, 1000, 3)
     self.assertEqual(p.characteristic_time(), 3100)
     # Indefinite event
     p = myokit.Protocol()
     p.schedule(1, 100, 0.5, 1000, 0)
     self.assertEqual(p.characteristic_time(), 1000)
     # Delayed indefinite event
     p = myokit.Protocol()
     p.schedule(1, 800, 250, 1000, 0)
     self.assertEqual(p.characteristic_time(), 1800)
     # Sequence of singular events
     p = myokit.Protocol()
     p.schedule(1, 0, 100)
     p.schedule(1, 100, 200)
     p.schedule(1, 300, 300)
     self.assertEqual(p.characteristic_time(), 600)
Ejemplo n.º 2
0
 def create(start, duration, period=0, multiplier=0):
     myokit.ProtocolEvent(1, start, duration, period, multiplier)