A new approach in modeling the behavior of RPC detectors