|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢! t S) j7 P1 d* n* [) a9 z
; ~3 _) w" m" Q) Q8 ^! r2 ~题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
% `& [4 ]# {; Y- e我的method是这样写的,但老是出错!
) C4 c: @' l, ]0 h0 Z8 W b1 vis
; r4 T. V& W6 f& g3 udo
) [8 x, z+ Z' O* j if @.name = "small" then
7 e% K& _$ ?1 L4 f; W singleProc.proctime :=1*60; ( {) z6 C9 M: A
@.move(drain);/ I# ^# T- g! Y: w" i: s7 J
else3 i' ^9 w, p! Q
singleProc.proctime :=10*60; 4 @. g( N$ q2 l. W7 b
@.move(drain);& ?' o, ?; U) `
end;
$ g5 {" t, W& C1 z! u4 S. Lend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|