a rules engine acquires sensor data from sensors applied to the heart to determine the presence of a rapid heartbeat . the rules engine applies rules to the sensor data to determine whether to deliver an electrical waveform to a vagus nerve . the rules engine further determines whether an electrical waveform should be applied to the heart and , if so , the type of electrical waveform .