|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
5 o9 H. a/ _- R# b0 K, O9 _: A1 W$ |- \( l8 I# y
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
2 y7 c: W6 S; g& o" |& s! L# g0 L0 E我的method是这样写的,但老是出错!! v- C0 _5 \. ]
is
) O/ K$ T p' G2 m2 Xdo
, ^! W- ~# R% k1 Q9 z if @.name = "small" then$ Z# I* Q9 ]. {2 w* p. `) B
singleProc.proctime :=1*60; 1 E4 g: i! d5 C9 A/ x! T* J$ D
@.move(drain);+ Z- o+ ~& R# @0 u, w3 R1 ~
else! R) C. u6 v% `: @! }- r4 p, g
singleProc.proctime :=10*60; ' ?% C) n) Z7 u
@.move(drain);% @2 l |, s5 z; B+ @" M; b
end;
4 d) [6 t: U" G; b! Nend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|