Increased refractory period from 20 minutes to 30 minutes.
This commit is contained in:
parent
54ef13d817
commit
bb89e13737
@ -33,7 +33,7 @@ The bot will consider an aircraft to be "circling" if:
|
||||
300 feet or more.
|
||||
|
||||
5. If an aircraft was previously circling, it must be considered
|
||||
not-circling for at least 20 minutes before it is again eligible to
|
||||
not-circling for at least 30 minutes before it is again eligible to
|
||||
be considered circling.
|
||||
|
||||
There are a lot of weird flight paths that can meet criterion #1, and
|
||||
|
@ -112,7 +112,7 @@
|
||||
pruned-db (reduce-kv (fn [m k v]
|
||||
(if (or (> (count (:history v)) 0)
|
||||
(if-let [ended-circling-time (:ended-circling-time v)]
|
||||
(< (- now ended-circling-time) (* 20 60 1000))))
|
||||
(< (- now ended-circling-time) (* 30 60 1000))))
|
||||
(assoc m k v)
|
||||
m))
|
||||
{}
|
||||
@ -207,7 +207,7 @@
|
||||
(and currently-circling?
|
||||
(not previously-circling?)
|
||||
(or (nil? (:ended-circling-time ac))
|
||||
(> (- now (:ended-circling-time ac)) (* 20 60 1000))))
|
||||
(> (- now (:ended-circling-time ac)) (* 30 60 1000))))
|
||||
(let [new-ac (assoc ac :started-circling-time now)]
|
||||
(recur (rest old-db)
|
||||
(assoc new-db icao new-ac)
|
||||
@ -320,12 +320,12 @@
|
||||
|
||||
;; If the centroid of the aircraft's positions is less than this close
|
||||
;; to an airport, then it's probably just doinf flight training.
|
||||
(def minimum-airport-distance-miles 2.5)
|
||||
(def minimum-airport-distance-km 2.5)
|
||||
;;(def minimum-airport-distance-miles 0)
|
||||
|
||||
(defn process-potential-circle [ac config now]
|
||||
(p/let [icao (:icao ac)
|
||||
centroid (geo/centroid (filter #(< (- now (:time %)) (* 3 60 1000)) (:history ac)))
|
||||
centroid (geo/centroid (filter #(< (- now (:time %)) (* 6 60 1000)) (:history ac)))
|
||||
lat (:lat centroid)
|
||||
lon (:lon centroid)
|
||||
airport (closest-airport lat lon)
|
||||
@ -335,11 +335,11 @@
|
||||
(log-info "%s: Closest airport is %s, distance: %s"
|
||||
(:icao ac) (:label airport-properties) (:distance airport-properties))
|
||||
(log-info "%s: No airports nearby" (:icao ac)))
|
||||
(if (and airport-properties (<= (:distance airport-properties) minimum-airport-distance-miles))
|
||||
(log-info "%s: Filtering out because it's %s miles (minimum is %s) from %s"
|
||||
(if (and airport-properties (<= (:distance airport-properties) minimum-airport-distance-km))
|
||||
(log-info "%s: Filtering out because it's %s km (minimum is %s) from %s"
|
||||
(:icao ac)
|
||||
(:distance airport-properties)
|
||||
minimum-airport-distance-miles
|
||||
minimum-airport-distance-km
|
||||
(:label airport-properties)
|
||||
())
|
||||
(do
|
||||
@ -360,8 +360,10 @@
|
||||
wiki-nearby (filter feature-has-wikipedia-page? nearby)]
|
||||
(log-info "%s: Nearby geo search: %s potential landmarks, %s with wikipedia pages"
|
||||
icao (count nearby) (count wiki-nearby))
|
||||
(doseq [l (take 3 nearby)]
|
||||
(log-info "%s: Landmark: %s") (:properties l))
|
||||
(doseq [f wiki-nearby]
|
||||
(log-info "%s: %s %s"
|
||||
(log-info "%s: Wiki landmark: %s %s"
|
||||
icao
|
||||
(get-in f [:properties :label] f)
|
||||
(get-in f [:properties :addendum] f)))
|
||||
|
Loading…
Reference in New Issue
Block a user