A rule-based firing model for neural networks