|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
3 c; [9 E0 w' a' i0 L' }" ]7 h; N- U8 ?6 c+ j
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?$ q+ D, N! ~2 {+ a1 J8 k
我的method是这样写的,但老是出错!
3 b5 x8 q( \! ~( V$ N5 j8 s2 F I9 Iis
2 X6 E; K! j3 a. a4 {% P* a: A8 Qdo
: _4 u/ u1 P4 K f5 a( E- a if @.name = "small" then' |! ~) R6 V( X& q! Z
singleProc.proctime :=1*60;
8 B! U" y2 ]7 f" r8 H, {7 x @.move(drain);1 k4 F7 d6 I. w; r2 R! _; {( L7 N
else. W* c6 J* Q8 f2 \' m3 m* `' k
singleProc.proctime :=10*60; ; C( g, |% M% O' j
@.move(drain);; C8 }' P$ V" b
end;
5 j" Z3 g/ X4 {$ ?) Hend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|