|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢+ d6 D7 x/ Z) `! l
) w2 X# B! z+ A# u7 d
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
) H, l2 M8 O5 ^' M" n6 w0 z$ a* A我的method是这样写的,但老是出错!
- g9 e; M/ G' k& o4 eis
) @, z* w! b6 o- O; a- Y, @" edo 0 Q5 k; H$ `, h7 T0 ]8 N0 V F
if @.name = "small" then
1 {- C9 \0 {8 L3 ^ singleProc.proctime :=1*60;
$ A8 K- B: @; V9 J @.move(drain);# S0 B/ l3 v# {) {. C
else+ z0 d# G% U2 p- P
singleProc.proctime :=10*60; 6 f# j% _6 r& _& \) k4 e
@.move(drain);6 s; r0 N3 A' t2 i& m# a
end;! f4 h+ \1 u/ }
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|