|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢7 z$ m4 L0 B, X2 p8 U2 n m% @
6 E4 x; z0 b6 t5 g" p" c5 R题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
6 V; c* U0 F# t; U& w m我的method是这样写的,但老是出错!
2 f1 o0 C' j: F6 a* L0 i; ~$ \: f0 ]is
/ `" _$ p# O, _# x1 E, W1 Xdo , v# `2 q/ j* p6 S4 g
if @.name = "small" then4 b4 Y' s" s3 h% y1 q* y# d
singleProc.proctime :=1*60; T6 S/ t" a- l+ O- x
@.move(drain);
5 F7 g- u7 A: U, x+ ^$ [ else
5 T1 I0 P& `/ f! {" `: k singleProc.proctime :=10*60; 0 d# r6 e. B8 P3 Y' ~8 v$ y0 ~$ B
@.move(drain);% \3 c2 P0 @- x. a7 a! J
end;
. n3 _" f6 c# C5 G. u6 _end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|