|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢: i* ^; H% H" N4 ~- \( |# ^
8 E9 u( b5 R- S$ G5 e5 P9 w7 x" M题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
+ _7 T/ @' o: ^+ z我的method是这样写的,但老是出错!. z/ O+ b) i" m7 P* v7 e7 A) p
is, G5 J3 s) O5 |2 G1 x1 W0 W
do
# v, p8 }! c- e if @.name = "small" then! m6 x- a7 Z0 q5 j- g
singleProc.proctime :=1*60;
) C# Y2 t3 x3 i: ?% j0 @6 | @.move(drain);8 T/ U; J& k5 C; k* P, ?- Q
else
! N9 l2 s }( n3 {6 H singleProc.proctime :=10*60;
2 G3 Y, ] X7 [ @ @.move(drain);
0 |) s2 ]/ k0 R5 t/ I: X( l end;8 I6 Q5 U! T& D7 Y4 V n, ^/ Y- |
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|