|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
6 R1 v6 a g6 r9 z: h9 T& G4 z8 e* w0 K) ]
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?& l* `1 w' }% h" c7 Q. _
我的method是这样写的,但老是出错!
' i; ` b' B1 e0 _# vis
5 x5 R& T3 z. D" j4 jdo
# X3 n& J, l) i' b; E$ O if @.name = "small" then
+ e- @" \! K; @1 ^ singleProc.proctime :=1*60;
- Q0 @7 G$ g- r! Y/ H) [9 p @.move(drain);
9 W, y/ c. C1 j else
1 a& p: v& L0 S3 c# @! i9 n, x singleProc.proctime :=10*60; # @0 E- |; t" d1 P: h$ v; _
@.move(drain);8 |+ F( A% d8 |5 m" s" z( V2 l
end;
( d" r# X& Q. Yend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|