Map experienceSet = new Map();
when(face with thing){
String problem = extractProblem(thing);
String solution = experienceSet.get(problem);
if(solution == null){
solution = makeDecision(problem);
}
String result = dealThing(solution);
if(result is good){
experienceSet.put(problem, solution);
}else{
experienceSet.remove(problem);
putBadSolutionIntoToDoList(thing, solution);
}
}
网友评论