|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
$ e" J1 n3 p3 ]7 G6 t8 {
6 o" V6 z3 R$ [6 M2 }4 {3 \! K* p题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
" q) l; G7 E$ Z+ h# E$ `我的method是这样写的,但老是出错!. x# j% _3 M9 s5 o3 Q
is
# R$ P1 ~: _- ^2 [+ D+ N b1 \2 kdo
* |3 A2 M# p3 P if @.name = "small" then* C; l; v( M/ M% _1 z& s! {
singleProc.proctime :=1*60;
9 x; u2 E) h, ]: F @.move(drain);6 N+ e9 N$ q T; L4 o6 `% z
else
) K. V, V; m! C, B7 m/ H9 T1 L1 L singleProc.proctime :=10*60; 5 _3 `0 I& K3 d
@.move(drain);( b. }5 W! i! c. _4 F! g
end;5 {; p0 p2 k6 r% A/ J, G/ |
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|