|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
% s; Y$ a. s3 q; T( I
( j& q' @5 {! E' y' t题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?/ ~4 l9 [7 M: t5 I
我的method是这样写的,但老是出错!' z. c/ L) Z) g, |
is
1 K9 A9 f# H- a" Q. s: [" ~. X) Ndo 0 K4 G1 B1 q; x; m, j
if @.name = "small" then/ Q6 J0 i" B7 o# S% l( \! a! _8 l) e
singleProc.proctime :=1*60;
; e7 S3 I# B X$ V+ f: e @.move(drain);
+ d' [8 ~3 A0 ]& D8 ^ i else
& k4 i* V+ }! y6 P singleProc.proctime :=10*60;
, o9 ^$ A2 X$ @5 k @.move(drain);# L* G, g0 p5 P. H
end;- L) |$ ^2 Z2 i1 E! Z* @) q
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|