Class Parser


  • public class Parser
    extends java.lang.Object
    A class for parsing map and scenario files that are using the Moving AI Labs format: https://movingai.com/benchmarks/formats.html.
    • Constructor Summary

      Constructors 
      Constructor Description
      Parser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int[][] parseMap​(java.io.File file)
      Parses the map file given as the argument.
      static Scenario[] parseScenario​(java.io.File file)
      Parses the scenario file given as the argument.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Parser

        public Parser()
    • Method Detail

      • parseMap

        public static int[][] parseMap​(java.io.File file)
                                throws java.io.IOException
        Parses the map file given as the argument.
        Parameters:
        file - The map file
        Returns:
        the map as a 2d int array where 0 indicates the square is passable and 1 means it is not
        Throws:
        java.io.IOException
      • parseScenario

        public static Scenario[] parseScenario​(java.io.File file)
                                        throws java.io.IOException
        Parses the scenario file given as the argument.
        Parameters:
        file - the scenario file
        Throws:
        java.io.IOException