|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢1 x2 m- q% v4 _
5 ~* ]# d6 V3 c) b, G/ P( B& ~. k
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
, R" k7 D7 \, h! r; K我的method是这样写的,但老是出错!. b- z$ Y( a1 u) f8 N0 a* \
is( u. R u. k+ E: ~9 n
do . P6 N3 a C5 n( r9 {, F
if @.name = "small" then( E; d+ N0 G. e- U! Q
singleProc.proctime :=1*60; $ S9 f9 u: _8 ]! V z) N( X
@.move(drain);
/ k6 Q, k* s% ~1 C# q else
1 u% {; x( |9 h singleProc.proctime :=10*60;
- g5 ~5 t- @4 P/ D' S @.move(drain);( Z) ~. } b, i' ~8 U: W8 n- ^
end;
5 M/ J* p0 L5 A: ^- [! F2 a$ u" ?end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|