|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢1 E5 Z7 F7 r" Q' y. l8 Y: Q
+ ^: A" e' ]. [+ i" k6 s
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
0 F7 ]' V. y, h! Z8 I; P1 Z我的method是这样写的,但老是出错!- d& r, T- J r5 |9 p
is
- [2 T+ U5 V7 F$ p9 Udo % w" b2 ?- n0 K4 o; o E% Z
if @.name = "small" then
7 J: p4 r- |/ e4 h! w* v singleProc.proctime :=1*60; 2 W4 u; j1 T5 s h
@.move(drain);8 Q) H" I _2 ~* m/ \3 N( _
else* b# U9 D& g/ A. ]2 K
singleProc.proctime :=10*60; % |% s- H" S7 n- b: Z3 |
@.move(drain);
2 Q" U& k, A, e! Y2 J: F" b end;
# v6 _' B3 a. e3 O& R" k+ H% }0 iend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|