|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢, O4 g& \& t2 t$ \
/ @/ C5 l. A/ q6 R F' w5 G+ U题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?2 y4 Z& h: K+ E( A% z! a
我的method是这样写的,但老是出错!
# g0 U" ~% t C4 kis/ G* ~1 C* \! D, w0 k$ q
do # L, G; Z8 y" E) P, V0 i' j
if @.name = "small" then7 K7 x2 J( z* S, A d
singleProc.proctime :=1*60;
8 [) U! T4 _7 h& p7 [9 v4 H6 l% L0 B @.move(drain);9 Y% P) L" s. Z) \2 G: G+ k7 o
else- c* J7 H3 u7 W/ q; Y- D4 d
singleProc.proctime :=10*60; * b6 N' ?% j6 S3 x+ x
@.move(drain);
$ O |% n5 B% O# ?5 Q1 T) g6 m, T+ W end;
4 P# F5 z/ z8 `3 a7 I- p' U/ U# }. zend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|