Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
공백 변경 숨기기
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
텍스트 스타일
모양 변경
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled diff
생성일
9년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
2 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
59 행
복사
10 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
60 행
복사
복사
복사됨
복사
복사됨
Policy
Iteration
Value
Iteration
복사
복사됨
복사
복사됨
public boolean performReachabilityFrom(State si){
public boolean performReachabilityFrom(State si){
HashableState sih = this.stateHash(si);
HashableState sih = this.stateHash(si);
//if this is not a new state and we are not required to perform a new reachability analysis, then this method does not need to do anything.
//if this is not a new state and we are not required to perform a new reachability analysis, then this method does not need to do anything.
if(valueFunction.containsKey(sih) && this.foundReachableStates){
if(valueFunction.containsKey(sih) && this.foundReachableStates){
return false; //no need for additional reachability testing
return false; //no need for additional reachability testing
}
}
DPrint.cl(this.debugCode, "Starting reachability analysis");
DPrint.cl(this.debugCode, "Starting reachability analysis");
//add to the open list
//add to the open list
LinkedList <HashableState> openList = new LinkedList<HashableState>();
LinkedList <HashableState> openList = new LinkedList<HashableState>();
Set <HashableState> openedSet = new HashSet<HashableState>();
Set <HashableState> openedSet = new HashSet<HashableState>();
openList.offer(sih);
openList.offer(sih);
openedSet.add(sih);
openedSet.add(sih);
while(!openList.isEmpty()){
while(!openList.isEmpty()){
HashableState sh = openList.poll();
HashableState sh = openList.poll();
//skip this if it's already been expanded
//skip this if it's already been expanded
if(valueFunction.containsKey(sh)){
if(valueFunction.containsKey(sh)){
continue;
continue;
}
}
복사
복사됨
복사
복사됨
//do not need to expand from terminal states
//do not need to expand from terminal states
if set to prune
if(
model.terminal(sh.s())
){
if(
this.
model.terminal(sh.s())
&& stopReachabilityFromTerminalStates
){
continue;
continue;
}
}
복사
복사됨
복사
복사됨
valueFunction.put(sh,
valueInitializer.value(sh.s()));
this.
valueFunction.put(sh,
this.
valueInitializer.value(sh.s()));
List<Action> actions = this.applicableActions(sh.s());
List<Action> actions = this.applicableActions(sh.s());
for(Action a : actions){
for(Action a : actions){
List<TransitionProb> tps = ((FullModel)model).transitions(sh.s(), a);
List<TransitionProb> tps = ((FullModel)model).transitions(sh.s(), a);
for(TransitionProb tp : tps){
for(TransitionProb tp : tps){
HashableState tsh = this.stateHash(tp.eo.op);
HashableState tsh = this.stateHash(tp.eo.op);
if(!openedSet.contains(tsh) && !valueFunction.containsKey(tsh)){
if(!openedSet.contains(tsh) && !valueFunction.containsKey(tsh)){
openedSet.add(tsh);
openedSet.add(tsh);
openList.offer(tsh);
openList.offer(tsh);
}
}
}
}
}
}
복사
복사됨
복사
복사됨
}
}
DPrint.cl(this.debugCode, "Finished reachability analysis; # states: " + valueFunction.size());
DPrint.cl(this.debugCode, "Finished reachability analysis; # states: " + valueFunction.size());
this.foundReachableStates = true;
this.foundReachableStates = true;
복사
복사됨
복사
복사됨
this.hasRunVI = false;
return true;
return true;
}
}
저장된 비교 결과
원본
파일 열기
Policy Iteration public boolean performReachabilityFrom(State si){ HashableState sih = this.stateHash(si); //if this is not a new state and we are not required to perform a new reachability analysis, then this method does not need to do anything. if(valueFunction.containsKey(sih) && this.foundReachableStates){ return false; //no need for additional reachability testing } DPrint.cl(this.debugCode, "Starting reachability analysis"); //add to the open list LinkedList <HashableState> openList = new LinkedList<HashableState>(); Set <HashableState> openedSet = new HashSet<HashableState>(); openList.offer(sih); openedSet.add(sih); while(!openList.isEmpty()){ HashableState sh = openList.poll(); //skip this if it's already been expanded if(valueFunction.containsKey(sh)){ continue; } //do not need to expand from terminal states if(model.terminal(sh.s())){ continue; } valueFunction.put(sh, valueInitializer.value(sh.s())); List<Action> actions = this.applicableActions(sh.s()); for(Action a : actions){ List<TransitionProb> tps = ((FullModel)model).transitions(sh.s(), a); for(TransitionProb tp : tps){ HashableState tsh = this.stateHash(tp.eo.op); if(!openedSet.contains(tsh) && !valueFunction.containsKey(tsh)){ openedSet.add(tsh); openList.offer(tsh); } } } } DPrint.cl(this.debugCode, "Finished reachability analysis; # states: " + valueFunction.size()); this.foundReachableStates = true; return true; }
수정본
파일 열기
Value Iteration public boolean performReachabilityFrom(State si){ HashableState sih = this.stateHash(si); //if this is not a new state and we are not required to perform a new reachability analysis, then this method does not need to do anything. if(valueFunction.containsKey(sih) && this.foundReachableStates){ return false; //no need for additional reachability testing } DPrint.cl(this.debugCode, "Starting reachability analysis"); //add to the open list LinkedList <HashableState> openList = new LinkedList<HashableState>(); Set <HashableState> openedSet = new HashSet<HashableState>(); openList.offer(sih); openedSet.add(sih); while(!openList.isEmpty()){ HashableState sh = openList.poll(); //skip this if it's already been expanded if(valueFunction.containsKey(sh)){ continue; } //do not need to expand from terminal states if set to prune if(this.model.terminal(sh.s()) && stopReachabilityFromTerminalStates){ continue; } this.valueFunction.put(sh, this.valueInitializer.value(sh.s())); List<Action> actions = this.applicableActions(sh.s()); for(Action a : actions){ List<TransitionProb> tps = ((FullModel)model).transitions(sh.s(), a); for(TransitionProb tp : tps){ HashableState tsh = this.stateHash(tp.eo.op); if(!openedSet.contains(tsh) && !valueFunction.containsKey(tsh)){ openedSet.add(tsh); openList.offer(tsh); } } } } DPrint.cl(this.debugCode, "Finished reachability analysis; # states: " + valueFunction.size()); this.foundReachableStates = true; this.hasRunVI = false; return true; }
비교하기