|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
7 ? X/ }' M- Q) f- S# `1 G$ c7 z" \. U# w7 `
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?: W+ k" J* X/ q( n, ~3 }
我的method是这样写的,但老是出错!6 e5 I5 c+ ~) }
is
" h6 ? K6 [. {; `do 1 k. R1 }+ F3 e, U# m i' T) M
if @.name = "small" then
& Q, G5 J9 {* w% g& U! J7 ?6 F singleProc.proctime :=1*60; - D/ b- n9 I s2 t2 [
@.move(drain);* \0 ]( _# L* h `
else! E) b0 }( b; W) u5 q
singleProc.proctime :=10*60; " l2 G& Y: `) }
@.move(drain);
! P+ T7 u/ }: t r: Y end;( ~5 V# I7 p6 _: o8 [0 @: n
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|