|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
) }/ h4 Y& f9 F3 O0 A
' k) W' h+ @% J& R题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
- a; x9 ?, l; a1 P1 e9 R我的method是这样写的,但老是出错!* F) Z$ |0 h& c" n& V4 J
is% ?4 J7 s, W, \' R
do 3 x* b, ~2 b* }" W5 B8 e* {
if @.name = "small" then4 Z9 D9 x5 _6 H3 g8 n
singleProc.proctime :=1*60;
7 O- z& t; v0 [* b+ E/ U: R @.move(drain);
7 J' i& o) B- h else' k! N* T6 k8 I4 N( C5 z
singleProc.proctime :=10*60; ! E" m4 o- a8 C2 ]( I0 Z
@.move(drain);! O: l$ {; O. \) J' W
end;! E8 ?; [' B& Z; ^. @# D7 j
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|