|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢" }* r7 I! d9 P
: |6 y+ A% A& \" I) W0 F5 ]8 g: o$ L
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?2 s# A. p, @# |1 F- L y
我的method是这样写的,但老是出错!+ y5 `# a# ?/ Z* P$ y; f, c+ W
is
; C' ]* H+ b6 D9 b9 ~8 Rdo 9 G* B9 M$ ~- q4 x0 f
if @.name = "small" then
$ \5 r( v" v+ q- b% B singleProc.proctime :=1*60; 1 s8 a8 H$ y4 t$ B% i' M; N; a
@.move(drain);" `7 z' t; K' o- ]) h0 ]
else. [+ Q8 u7 p% |4 Y( n- P3 H
singleProc.proctime :=10*60;
3 n, U+ X+ X1 g; o! A/ m @.move(drain);
& T" X- r' g% h9 K" } end;
3 s. b5 H! [% 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 ...
|