X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Code%2FProjects%2FPacketLevelSignatureExtractor%2Fsrc%2Fmain%2Fjava%2Fedu%2Fuci%2Fiotproject%2FSignatureGenerator.java;h=ea3e39b41b49e24e00847d2c41481b5fc5d69917;hb=6b260fc32264d89db32fdb745cd4f7c58d8acced;hp=57e0a0e9ca2d4c5a07f6c49519d114837ddf16a2;hpb=0e1a130642de8343806aa43e4cfc132ca2ae2a45;p=pingpong.git diff --git a/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/SignatureGenerator.java b/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/SignatureGenerator.java index 57e0a0e..ea3e39b 100644 --- a/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/SignatureGenerator.java +++ b/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/SignatureGenerator.java @@ -47,6 +47,10 @@ public class SignatureGenerator { * 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 { @@ -214,10 +218,8 @@ public class SignatureGenerator { // 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.5); - //int upperBound = numberOfEventsPerType + (int)(numberOfEventsPerType * 0.5); + int lowerBound = numberOfEventsPerType - (int)(numberOfEventsPerType * CLUSTER_BOUNDS_MULTIPLIER); + int upperBound = numberOfEventsPerType + (int)(numberOfEventsPerType * CLUSTER_BOUNDS_MULTIPLIER); int minPts = lowerBound; DBSCANClusterer onClusterer = new DBSCANClusterer<>(eps, minPts); List> onClusters = onClusterer.cluster(onPairs);