|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
+ @( {% z, X' g' Y+ {
2 k: G6 C B( B P m题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?* F1 V, Y k R5 q
我的method是这样写的,但老是出错!
# ?- |1 `8 p) I/ u+ Zis
' u. ?; c6 ?, Z4 V Jdo 2 Q4 ?6 x5 ?. V% e7 i) n* s9 r
if @.name = "small" then h! m9 |0 d, v+ ]6 _
singleProc.proctime :=1*60;
; r" E/ P! Z ^, _: g' M1 i @.move(drain);/ g: i7 O6 ]! l b. F2 ]" h# y
else8 r9 a% C' O0 y: L5 E: B
singleProc.proctime :=10*60; 3 Z" D H4 S2 \& T1 R
@.move(drain);: u, \1 w! `% a4 p* ~3 u
end;
9 z! F v+ q8 l* Z; lend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|