|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢3 t' M l9 i- g5 d2 E
) r& f" O- y% H1 ?; F- B
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
: m D" g, l: A6 P5 E, z; w5 u我的method是这样写的,但老是出错!
! j" ]9 `. ]7 V& d5 \# |is0 d' L3 Z. a% D# U
do
$ g$ P. r- M3 \8 P if @.name = "small" then- d1 _7 t& _. {4 N
singleProc.proctime :=1*60; ; d2 ?. P. K3 c$ c- t
@.move(drain);3 d3 p1 |( H8 y/ G8 x R
else
% q" X$ n5 U' a/ s9 e7 i singleProc.proctime :=10*60;
2 L7 L% S1 R9 d! ], I @.move(drain);9 U% W* _+ k! J& P. v" f6 t& U
end;
! c8 B9 }7 t" d4 lend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|