NetLogo 코드를 디버그하려고합니다. 이웃의 확률로부터 목록을 만들고 'reduce'를 사용하여 목록의 모든 값을 함께 곱하려고합니다. 늘어나는만큼 내가 달리 말할 수있는이 실행중인 경우를 제외하고 런타임 오류가 아래와 같습니다.reduce를 사용하여 NetLogo의 목록 곱하기
또한 'let P reduce [? 1 *? 2] prob-list'를 사용하여 시도했지만 동일한 오류가 발생합니다.
참고 Prob_water_water_breaking, Prob_solute_solute_breaking은 '글로벌'로 정의되며 설정에서 특정 품종에 할당됩니다.
* expected input to be a number but got the list [0.3 0.3 0.3] instead.
error while solute 2 running *
called by procedure ALL-PROBABILITIES
called by procedure GO
called by Button 'go'
이 어떤 도움이 아주 많이 주시면 감사하겠습니다, 정말 고마워요 :
to-report all-probabilities
let prob-list (list ([Prob_water_water_breaking ] of turtles-on neighbors4)
([Prob_solute_solute_breaking ] of turtles-on neighbors4)
let P reduce * prob-list ;;this is the line that's causing the error
report P
end
이것은 런트시 오류입니다!
감사합니다. Nicolas! 그게 문제를 해결했습니다! 도와 주셔서 정말 고맙습니다. –