choco.cp.solver.constraints.global.geost.util
Class InputParser
java.lang.Object
choco.cp.solver.constraints.global.geost.util.InputParser
public final class InputParser
- extends Object
This class parses a text file that describes the problem to be solved. While parsing it creates the choco problem, the objects, shapes and shifted boxes and stores them locally to this class.
Then to create the environment that the constraint uses all we need to do is call global.Setup.createEnvironment(parser) and give it this object as an argument.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
protected static final Logger LOGGER
InputParser
public InputParser()
InputParser
public InputParser(String path,
int dim)
InputParser
public InputParser(InputParser.GeostProblem gp,
int dim)
getObjects
public List<GeostObject> getObjects()
getShapes
public List<Shape> getShapes()
getShiftedBoxes
public List<ShiftedBox> getShiftedBoxes()
parse
public boolean parse()
throws IOException
- Throws:
IOException
parseFile
public boolean parseFile()
throws IOException
- This is the essential function of this class it. It is the function that executes the parsing. The file to be parsed is read
from the local variable path. The value of path is given to the constructor as parameter.
- Returns:
- The function returns false if there was an error during the parsing otherwise it returns true.
- Throws:
IOException
parseGP
public boolean parseGP()
- This is the essential function of this class it. It is the function that executes the parsing. Lists to be parsed are read.
- Returns:
- The function returns false if there was an error during the parsing otherwise it returns true.
Copyright © 2012. All Rights Reserved.