Exemplo n.º 1
0
        public override double ComputeDistanceToProtocolModel(FeatureBase sampleFeature)
        {
            var featureValue = sampleFeature as BytePairsReoccuringBase;

            if (this.ModelBytePairsValues != null)
            {
                foreach (var modelBytePairsValue in this.ModelBytePairsValues)
                {
                    if (modelBytePairsValue.SequenceEqual(featureValue.FeatureBytePairsValue))
                    {
                        return(0);
                    }
                }
            }
            else
            {
                if (this.FeatureBytePairsValue.SequenceEqual(featureValue.FeatureBytePairsValue))
                {
                    return(0);
                }
            }
            return(1);
        }
 public override double ComputeDistanceToProtocolModel(FeatureBase sampleFeature)
 {
     return(Math.Abs(this.Normalize(this.FeatureValue) - this.Normalize(sampleFeature.FeatureValue)));
 }
Exemplo n.º 3
0
 public override double ComputeDistanceToProtocolModel(FeatureBase sampleFeature)
 {
     return(this.L4ProtocolType == (sampleFeature as TransportProtocolType)?.L4ProtocolType? 0 : 1);
 }
 public override double ComputeDistanceToProtocolModel(FeatureBase sampleFeature)
 {
     return(this.FeatureValue.Equals(sampleFeature.FeatureValue)? 0 : 1);
 }