|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢- \' ~3 V/ n Z, D
' s5 d F/ w' o
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
: c' h3 ]$ x& D) Q P. h9 N9 m8 t我的method是这样写的,但老是出错!2 }9 e5 W+ B5 S. j/ A$ _
is
2 V( s% v2 q$ B( |do
- v- y( q9 F8 { if @.name = "small" then" \. X* Z# m: f) j
singleProc.proctime :=1*60;
b, a, D5 u" v" o1 L @.move(drain);
; ~. ?, i1 ?$ B+ f/ z" r; W- h/ ?6 I else3 W0 _* n, L$ Q/ n1 S! J `
singleProc.proctime :=10*60;
2 T9 `7 c7 @% ^7 f @.move(drain);9 `) W* c% D2 d/ S
end;5 V& k7 z9 f) I- K2 [# x( |
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|