<commit_before>require 'spf/gateway/configuration'
require 'spf/extensions/fixnum'

APPLICATION_CHARACTERIZATION = <<END
application "participants",
  priority: 50.0,
  allow_services: [ :find_text, :listen ],
  service_policies: {
    find_text: {
      processing_pipeline: :ocr,
      filtering_threshold: 0.05,
      uninstall_after: 2.minutes,
      distance_decay: {
        type: :exponential,
        max: 1.km
      }
    },
    listen: {
      processing_pipeline: :identify_song,
      time_decay: {
        type: :linear,
        max: 2.minutes
      }
    }
  },
  dissemination_policy: {
    subscription: "participants",
    retries: 1,
    wait: 30.seconds,
    on_update: :overwrite,
    allow_channels: :WiFi
  }
END

PIG_REPROGRAM_REQUEST_EXAMPLE = <<END
PROGRAM #{APPLICATION_CHARACTERIZATION.bytesize}
#{APPLICATION_CHARACTERIZATION}
END

PIG_SERVICE_REQUEST_EXAMPLE = <<END
REQUEST participants/find
User 3;44.838124,11.619786;find "water"
User 5;44.838124,11.619786;find "booze"
User 6;44.838124,11.619786;find "smoke"
END

# this is the whole reference configuration
# (useful for spec'ing configuration.rb)
REFERENCE_CONFIGURATION =
  APPLICATION_CHARACTERIZATION

# evaluator = Object.new
# evaluator.extend SPF::Gateway::Configurable<commit_msg>Added list of PIGs to the reference configuration<commit_after>require 'spf/gateway/configuration'
require 'spf/extensions/fixnum'

APPLICATION_CHARACTERIZATION = <<END
application "participants",
  priority: 50.0,
  allow_services: [ :find_text, :listen ],
  service_policies: {
    find_text: {
      processing_pipeline: :ocr,
      filtering_threshold: 0.05,
      uninstall_after: 2.minutes,
      distance_decay: {
        type: :exponential,
        max: 1.km
      }
    },
    listen: {
      processing_pipeline: :identify_song,
      time_decay: {
        type: :linear,
        max: 2.minutes
      }
    }
  },
  dissemination_policy: {
    subscription: "participants",
    retries: 1,
    wait: 30.seconds,
    on_update: :overwrite,
    allow_channels: :WiFi
  }
END

PIGS_LIST = <<END
pigs_list: [
  pig: {
  ip: 192.168.1.1,
  port: 52160,
  gps_lat: 44.5432523,
  gps_long: 13.234532
  },
  pig: {
    ip: 192.168.1.2,
    port: 52160,
    gps_lat: 44.543133,
    gps_long: 13.09873
  }
]
END

PIG_REPROGRAM_REQUEST_EXAMPLE = <<END
PROGRAM #{APPLICATION_CHARACTERIZATION.bytesize}
#{APPLICATION_CHARACTERIZATION}
END

PIG_SERVICE_REQUEST_EXAMPLE = <<END
REQUEST participants/find
User 3;44.838124,11.619786;find "water"
User 5;44.838124,11.619786;find "booze"
User 6;44.838124,11.619786;find "smoke"
END

# this is the whole reference configuration
# (useful for spec'ing configuration.rb)
REFERENCE_CONFIGURATION =
  APPLICATION_CHARACTERIZATION

# evaluator = Object.new
# evaluator.extend SPF::Gateway::Configurable
{'fraction_non_alphanumeric': 0.10857956568173727, 'fraction_numerical': 0.06550373798504806, 'mean_word_length': 3.683333333333333, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3006916', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1028, 'n_words': 192}