* Directory for logging.
*/
private static String LOG_DIRECTORY = "./";
+ /**
+ * Multiplier for cluster bounds.
+ */
+ private static float CLUSTER_BOUNDS_MULTIPLIER = 0.1f;
public static void main(String[] args) throws PcapNativeException, NotOpenException, EOFException,
TimeoutException, UnknownHostException, IOException {
// Perform clustering on conversation logged as part of all ON events.
// Calculate number of events per type (only ON/only OFF), which means half of the number of all timestamps.
int numberOfEventsPerType = triggerTimes.size() / 2;
-// int lowerBound = numberOfEventsPerType - (int)(numberOfEventsPerType * 0.1);
-// int upperBound = numberOfEventsPerType + (int)(numberOfEventsPerType * 0.1);
- int lowerBound = numberOfEventsPerType - (int)(numberOfEventsPerType * 0.2);
- int upperBound = numberOfEventsPerType + (int)(numberOfEventsPerType * 0.2);
+ int lowerBound = numberOfEventsPerType - (int)(numberOfEventsPerType * CLUSTER_BOUNDS_MULTIPLIER);
+ int upperBound = numberOfEventsPerType + (int)(numberOfEventsPerType * CLUSTER_BOUNDS_MULTIPLIER);
int minPts = lowerBound;
DBSCANClusterer<PcapPacketPair> onClusterer = new DBSCANClusterer<>(eps, minPts);
List<Cluster<PcapPacketPair>> onClusters = onClusterer.cluster(onPairs);