Abstract Rule class¶
-
class
Rule.
Rule
(level, event)[source]¶ Generic Rule all specific Rules intherit from.
- Parameters
level (Level) – The Level this Rule is active on.
event (Event.Event) – The event the rule triggers.
Specific Rules¶
Zone Rule¶
-
class
Rule.
ZoneRule
(level, event, zone_type, delay)[source]¶ Bases:
Rule.Rule
A Rule that triggers if the animal is in a given type of zone.
- Parameters
level (Level) – The Level this Rule is active on.
event (Event.Event) – The event the rule triggers.
zone_type (str) – The type of Zone this Rule is active in.
delay (float) – How many seconds should be spent in the Zone before triggering.
Velocity Rule¶
-
class
Rule.
VelocityRule
(level, event, vel_rule_type, threshold, delay)[source]¶ Bases:
Rule.Rule
A Rule that triggers if the velocity is above or below a certain threshold.
- Parameters
level (Level) – The Level this Rule is active on.
event (Event.Event) – The event the rule triggers.
vel_rule_type (str) – Type of comparison. Can be ‘above’ or ‘below’.
threshold (float) – Absolute velocity should be above or below this value.
delay (float) – How long should the absolute velocity be above or below the threshold.
Smooth Velocity Rule¶
-
class
Rule.
SmoothVelocityRule
(level, event, bin_size, vel_rule_type, threshold, delay)[source]¶ Bases:
Rule.VelocityRule
A Rule that triggers if the moveing average of velocity is above or below a certain threshold.
- Parameters
level (Level) – The Level this Rule is active on.
event (Event.Event) – The event the rule triggers.
bin_size (int) – How many velocities should be used for calculating the moving average.
vel_rule_type (str) – Type of comparison. Can be ‘above’ or ‘below’.
threshold (float) – Smoothed absolute velocity should be above or below this value.
delay (float) – How long should the smoothed absolute velocity be above or below the threshold.
Speed Rule¶
-
class
Rule.
SpeedRule
(level, event, speed_rule_type, threshold, bin_size)[source]¶ Bases:
Rule.Rule
A Rule that triggers if the absolute integral of the velocity on a given range is above or below a given threshold.
- Parameters
level (Level) – The Level this Rule is active on.
event (Event.Event) – The event the rule triggers.
speed_rule_type (str) – Type of comparison. Can be ‘above’ or ‘below’.
threshold (float) – The calculated integral should be above or below this value.
bin_size (int) – How many velocities should be used for the integral.