|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢; A' C+ @/ `" e. }
7 A! C/ r! k) w7 h
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
9 z! e) I' H# ?3 ]我的method是这样写的,但老是出错!
! Q$ i1 Q" O" u* h, vis% s( @+ g" l- d; ~0 _
do
, A( {7 g8 H( a1 m% p if @.name = "small" then& ?' f+ u. t7 J5 _0 G6 H
singleProc.proctime :=1*60;
! ?9 p, A- J" h n @.move(drain);
6 W8 l! N. K6 n# L6 T& x else$ G1 G a0 h3 d0 k2 q, R& Z
singleProc.proctime :=10*60;
/ `$ b) }' b- ~. {! m @.move(drain);6 x8 [* S3 L* |; K$ I0 j
end;7 Z3 K* y+ v3 d, @) Y2 P$ s 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 ...
|