|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢% ~9 Z" G/ F5 ~7 |
, V$ @: S: A: _) I- x' k
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?, ~+ E' C- Y- Y& w, s) L7 Z! w
我的method是这样写的,但老是出错!
, `" e" K' I. Y' j0 J$ ais# N A9 V' {7 U0 q
do
& [* \2 i" ~3 X9 M$ E if @.name = "small" then) g5 W7 Y2 G9 J: D) q c y( C
singleProc.proctime :=1*60; 7 U. K0 F/ ^9 Y
@.move(drain);: H) v4 U( R" }) T% k
else/ k. l* T: U( y3 y
singleProc.proctime :=10*60; " w/ V# b! F2 K0 w
@.move(drain);
$ f1 {2 L% b+ u! w" T end;% W; `( Y* q$ r/ }( W/ o
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|