|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
6 @+ X4 m, n5 a, K; H; L0 n0 }8 h
# u2 Y. D: M0 Q* A8 A1 `3 |0 ~4 m: B题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
( Q# |" K9 F7 @3 f我的method是这样写的,但老是出错!
3 T+ N f' r$ U* B; ?! v9 Ris
! s) O* W6 ^! w( c% kdo
3 H% Q( h6 G( L% o( q: W, e0 Y if @.name = "small" then& O; z' g6 J- g3 ^- N5 T
singleProc.proctime :=1*60; x9 G& K, u0 y7 f6 v
@.move(drain);$ a2 k- m% Q) X; n. V K
else
+ H" E0 n( l1 D/ ^; G% t+ | singleProc.proctime :=10*60; ) _2 P8 ]) t4 C, l) I/ u
@.move(drain);8 y9 C& v; ?7 `6 r5 o; ^0 O$ r' S
end;
/ n- |# x3 I) I# @) u* H f+ v0 K* Rend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|