|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
$ E6 k9 n4 ?6 i; R
( w9 I8 |2 ?9 ~. V" ~* V8 m题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?1 h7 V0 Q1 H7 D' B; E
我的method是这样写的,但老是出错!
9 \' E' t' u4 J( W, `is
5 `4 b2 }. I- y* _do
* F" V+ _/ c4 F) T3 Y% l" p9 C if @.name = "small" then1 `$ M9 C; r+ X; p/ P: R
singleProc.proctime :=1*60; ; B" Y# w S, {
@.move(drain);
0 X" Z6 Y/ l2 h* P. v3 p' Y else
# s- z$ s- Y/ v singleProc.proctime :=10*60;
" m: g0 q1 U3 s- o, @ @.move(drain); {) p& P& ~9 k2 c2 Q& Z3 d
end;1 Z3 h) ~* f$ Z( \- |3 C+ _3 ~
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|