|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
% T. |0 F' B! e7 }6 b% M+ D; Z; G' `) d: \3 @+ g q
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?. t" C/ P5 N1 S0 G6 n" k0 g4 J
我的method是这样写的,但老是出错!
# G) |9 ?. p7 `! [8 uis
* r) O0 ^) C. N( E3 d, i2 Mdo
! n; e4 f* E3 ~9 D+ { if @.name = "small" then
0 ^7 w7 K( l- }- v8 Y9 Y, b3 \+ r singleProc.proctime :=1*60;
9 O% Z( n0 m6 ] @.move(drain);# F0 U( c, a1 d& e6 D
else
! R" I- X1 c5 L N, q K2 ~ singleProc.proctime :=10*60;
. f) C ~3 |2 R$ i9 o @.move(drain);
6 i2 n4 Q" O( c4 h, |; T$ L end;
; O" E/ \* S6 l1 E; P9 Bend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|