|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢5 W: k- A$ Y! N$ r1 C
- N" A/ d. X1 q9 R
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
: t0 m b' Q& \' X我的method是这样写的,但老是出错!( K5 X8 _5 R' b9 f6 D3 }
is
9 d9 B3 g0 \5 }5 ~" k7 M( Q2 _. L& e* ^do - Z" Z- _* u( p7 }" Z6 y/ \
if @.name = "small" then7 o! g$ M K2 [2 \0 w
singleProc.proctime :=1*60;
& @3 J$ M, J- X9 M9 D @.move(drain);
* S1 w% |& g, l- x4 }, Y else* }# R" d: ?" ]! R6 X: z
singleProc.proctime :=10*60;
" r% e8 Z% d& S @.move(drain);" N& ]" U, I& z/ l% \
end;
) [6 @7 b& J" s* Eend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|