|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢& T, P1 E! G I# ^( P
& i0 F. I$ T/ ^9 n) C: i% |
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
+ ^. @" c7 |$ P* I" s4 [. _我的method是这样写的,但老是出错!
8 N# z* p5 A% \/ nis
3 u" V' G" E2 w$ l% t3 ?do
, }1 @% T) ^3 x5 C2 R! A, r/ a2 P if @.name = "small" then, O+ g1 w5 Y: K
singleProc.proctime :=1*60; 8 k, d7 j, m' Q) z! }1 J- e$ q
@.move(drain);4 X% `* q; I4 i6 R" N3 x, K2 q5 v
else/ V+ {8 o- j2 H9 z4 x
singleProc.proctime :=10*60; . ]* {5 U8 ^, ?* t _7 p$ J
@.move(drain);
9 _& D2 H; y1 N* l end;4 U$ z" A( ?* W7 L5 q& 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 ...
|