|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢6 M6 } q0 o# G
a8 m2 I+ ?" Z% j1 l$ L; m
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
8 y8 q8 T4 ~0 l. t我的method是这样写的,但老是出错!
- h9 K) i5 j# V+ l* }+ k. C/ k" Sis
2 I( r$ j$ f A7 r# bdo . q; T2 f, v8 [) t3 K9 J% N, P4 c
if @.name = "small" then
: \& i* {" H& J3 O, c; ?+ h8 w( l singleProc.proctime :=1*60;
3 {( C! Q/ p* f/ e9 s( r( D @.move(drain);% T& ^/ E, X& W
else
# f4 j2 m F3 W singleProc.proctime :=10*60; 2 W+ E! A+ Z8 ?. r- t* G# x
@.move(drain);; @9 }0 K9 }' w) [: |' @
end;6 T2 y2 l p( R7 C
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|