|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
/ \& ]9 D( g- C) R( t \' l" O/ F0 f; @, x/ ^) _9 g
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?, \; I9 x9 Q5 q1 O
我的method是这样写的,但老是出错!, @- H2 n/ |8 q7 @# H( g, M( b! r
is
4 U, C3 b ]- g4 z9 ?0 ~/ Z* R) Ddo
) s( I2 V5 b6 c4 s V; O+ P if @.name = "small" then
6 u+ p0 Y/ C0 z9 G2 T singleProc.proctime :=1*60; 5 s4 m) h4 I2 X& {: O _4 S ]: Z% r
@.move(drain);
* f9 e, l6 z6 F/ X2 U else
% y( w( [3 k! m1 w& d( J singleProc.proctime :=10*60;
: x; g- X& S' [8 G- ^ @.move(drain);
) g# r; \% M+ ]" ~9 h$ m end;" s9 R) z; B5 Y6 Z. Q
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|