Dispatcher

From wiki.gpii
Jump to: navigation, search

The Dispatcher is a GPII component in the matchmaking chain. Before a payload arrives at a matchmaker, it is analyzed by the dispatcher to forward it to the most fitting matchmaker.

Preferences

The dispatcher comes with a series of preferences that can be used in need and preference sets to alter the behavior of the dispatcher. These preferences behave exactly as normal preferences and can be but into context blocks with conditions.

matchMakerType (String)

http://registry.gpii.net/common/matchMakerType

Using this preference, the dispatcher is completely overridden and the specified matchmaker is used.

excludedMatchMakers (Array of Strings)

http://registry.gpii.net/common/excludedMatchMakers

Dispatching will happen as usual, but any matchmaker listed here will be excluded. Ignored if matchMakerType is set.

Capabilities

In order to select a matchmaker, the dispatcher uses metrics defined in the MatchMakerCapabilities.json. The dispatcher metrics are calculated as baseValue + forEachPreference * [prefs] + forEachUnsupportedPreference * [unsupportedPrefs]

[
   {
      "id": "flat",
      "conditions": {
         "supported": false
      }
   },
   {
      "id": "statistical",
      "preferences": {
         "supported" : []
      },
      "metrics": {
         "baseValue": -10.0,
         "forEachPreference": 1.0,
         "forEachUnsupportedPreference": 0.0
      }
   },
   {
      "id": "RuleBased",
      "preferences": {
         "supported" : [
            "http://registry.gpii.net/common/invertColours",
            "http://registry.gpii.net/common/language",
            "http://registry.gpii.net/common/speechRate",
            "http://registry.gpii.net/common/audioDescriptionEnabled",
            "http://registry.gpii.net/common/screenReaderTTSEnabled",
            "http://registry.gpii.net/common/subtitlesEnabled",
            "http://registry.gpii.net/common/auditoryOutLanguage",
            "http://registry.gpii.net/common/speakTutorialMessages",
            "http://registry.gpii.net/common/volume",
            "http://registry.gpii.net/common/fontSize",
            "http://registry.gpii.net/common/highContrastTheme",
            "http://registry.gpii.net/common/highContrastEnabled",
            "http://registry.gpii.net/common/punctuationVerbosity",
            "http://registry.gpii.net/common/cursorSize",
            "http://registry.gpii.net/common/magnifierEnabled",
            "http://registry.gpii.net/common/magnification",
            "http://registry.gpii.net/common/magnifierPosition",
            "http://registry.gpii.net/common/mouseTrailing",
            "http://registry.gpii.net/common/selfVoicingEnabled"
         ]
      },
      "metrics": {
         "baseValue": 10.0,
         "forEachUnsupportedPreference": -1.0
      }
   }
]

conditions.supported (bool)

Expresses whether the matchmaker can handle conditions. If false, the dispatcher will attempt to avoid this matchmaker at all costs if the payload contains conditions.

preferences.supported (array of strings)

A list of preferences supported by this matchmaker. Each preference contained in an active context that is not mentioned in this list will be counted as an unsupported preference for the forEachUnsupportedPreference metric.

metrics.baseValue (float)

The base utility assigned to this matchmaker.

metrics.forEachPreference (float)

Utility modifier for each preference (no matter if supported or not) in active context blocks.

metrics.forEachUnsupportedPreference (float)

Utility modifier for each unsupported preference in active context blocks.

Try Again

The dispatcher adds a new block to the matchmaker payloads, allowing he "try different matchmaker" functionality.

tryAgain.active (bool)

Enables "try different matchmaker".

tryAgain.excludedMatchMakers (array of strings)

Disables each matchmaker listed in this array from dispatching. Should store the matchmakers previously used.