|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢5 \5 r: L4 Q$ b* n8 A
3 C9 p% H9 v/ r7 z4 z题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
, Q5 {2 B& }$ N9 g我的method是这样写的,但老是出错!$ w+ |; b* ^+ J2 R% S, ~3 [" _
is5 f9 U$ K7 L) b; ~8 H, J$ z
do 3 L7 {, e$ l% ~+ }
if @.name = "small" then0 h+ z- O* O! r+ @9 y5 x& F* E6 t
singleProc.proctime :=1*60; : l2 s5 r/ \, E+ I
@.move(drain);7 R/ M: m8 T1 d: b" c4 e7 V4 m
else% ^! n; r4 q6 H, ]
singleProc.proctime :=10*60;
8 I+ r# o4 m, R( D1 B @.move(drain);- V& \- k+ N+ S4 g, }
end;
; j) c. `1 y$ A' ^% j8 C) _end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|