|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
1 P, e- K: l9 I/ A- O; P% ~
7 m3 E" a" a( D$ `% g2 N3 n题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?6 P0 {* M! m6 M9 M8 S9 }8 W
我的method是这样写的,但老是出错!1 t" F) v5 R( ~) i4 ?$ H% J- F
is
) t6 y7 N4 Y& V: {* O2 P+ K/ \3 J/ zdo , \1 f3 w# C8 y" f' x# W
if @.name = "small" then
7 e, @4 R9 E/ J8 ~ singleProc.proctime :=1*60; ' i) O5 p4 g! C. u6 G6 P
@.move(drain);
3 @/ f+ k1 r/ y else
f% ^% S% A! V singleProc.proctime :=10*60; $ B% R4 d( L& K$ D2 F
@.move(drain);
. K( J n9 n. E% j end;
4 B4 u+ N" W$ W/ |) {% D: bend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|