Symbolic Pattern Matching

From Robowiki
(Redirected from Symbolic pattern matching)
Jump to navigation Jump to search

A type of pattern matcher that maps the previous states of the enemy movement into a symbolic space (i.e., a group of symbols) that represent the different possible states of the bot. As it observes the enemy states, it concatenates them into a series that represents the change evolution of the robot from one state to the next. The matching process itself acts just like any other pattern matcher, by comparing the last items in the series (that represent the recent movement history) with the rest of the series (that represent the past movements of the robot).

Implementation and advantages

Usually, the symbols are characters and you create the series by concatenating them into an string. The advantages to using this kind of pattern matcher are:

  • Once you have translated the enemy history and stored it as a series of symbols, you don't need to build a matching function to match the patterns: you can simply use Java's built in string matching functions. It gives you lots of flexibility, beacuse the pattern matching algorithm is always the same; you just need to change the input variables and the mapping function to make it behave in many different ways.
  • Since you can use the Java built in functions to do the matching, you save code size if you are implementing small bots.
  • The Java engineers have put in much effort into making the search efficient, which makes this kind of matching much faster than brute force (MogBot style) matching.

See also

  • WeekendObsession - A major refinement in SPM that many other NanoBots and MicroBots are based on.
  • NanoLauLectrik - A good open source example of a symbolic pattern matcher.
  • Assertive - A more recent symbolic pattern matcher NanoBot. Also open source.