icfp-solver/src/main/java/ru/bosony/solvers/AbstractSolver.java
branchCleverSearch
changeset 46 4197f736166a
parent 42 2bd032a701a7
child 50 9530f55e9639
equal deleted inserted replaced
45:d357a16ee62d 46:4197f736166a
    18 	protected long					attemptsCount	= 0;
    18 	protected long					attemptsCount	= 0;
    19 
    19 
    20 	public AbstractSolver(Mine mine, SolverListener listener) {
    20 	public AbstractSolver(Mine mine, SolverListener listener) {
    21 		this.mine = mine;
    21 		this.mine = mine;
    22 		this.listener = listener;
    22 		this.listener = listener;
    23 		solve();
       
    24 	}
    23 	}
    25 
    24 
    26 	protected void addNewRoute(String route, int score) {
    25 	protected void addNewRoute(String route, int score) {
    27 		if (!routesWithScore.containsKey(route) && score > getMaxFoundScore()) {
    26 		if (!routesWithScore.containsKey(route) && score > getMaxFoundScore()) {
    28 			routesWithScore.put(route, score);
    27 			routesWithScore.put(route, score);
    37 				maxScore = foundScore;
    36 				maxScore = foundScore;
    38 		}
    37 		}
    39 		return maxScore;
    38 		return maxScore;
    40 	}
    39 	}
    41 
    40 
    42 	protected abstract void solve();
    41 	public abstract void solve();
    43 }
    42 }