public SolutionParser(String text) {

		if (text == null || text.equals("")) {
			System.err.println("Error parsing result");
			modelStatusCode = 99;
			modelStatus = "PARSING ERROR";
			solverStatusCode = 99;
			solverStatus = "PARSING ERROR";
			objective = Double.NaN;
			return;
		}

		this.text = text;

		Matcher m = modelPattern.matcher(text);
		if (m.find()) {
			modelStatusCode = new Integer(m.group(1));
			modelStatus = m.group(2).trim();
		} else {
			System.err.println("Error parsing model status");
			modelStatusCode = 99;
			modelStatus = "PARSING ERROR";
		}
		m = solverPattern.matcher(text);
		if (m.find()) {
			solverStatusCode = new Integer(m.group(1));
			solverStatus = m.group(2).trim();
		} else {
			System.err.println("Error parsing solver status");
			solverStatusCode = 99;
			solverStatus = "PARSING ERROR";
		}
		m = objPattern.matcher(text);
		if (m.find()) {
			objective = GAMSUtil.parseDouble(m.group(1));
		} else {
			System.err.println("Error parsing objective status");
			objective = Double.NaN;
		}
	}