|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
- e" [/ _/ @' [3 p0 U- |
; `/ }# u: `) y0 l) _2 ~' P题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
& y( U/ _; D8 m3 W* ^我的method是这样写的,但老是出错!' h1 B; A+ W; N
is
5 P$ P l: Q4 `do
7 f' W2 `' W5 S* w4 x0 r if @.name = "small" then
! Y0 c! x9 w! l, @! S6 {0 t singleProc.proctime :=1*60;
$ s2 F7 e$ H$ q) b F' Y @.move(drain);
* j2 v( u. q1 k1 n3 z! i else* ?, j& H2 w4 M. y5 I
singleProc.proctime :=10*60;
* o, c- L: F! {" j \! P @.move(drain);' k( W7 P8 y" a" _) W3 m
end;
/ x8 t; q8 A# `/ X- Kend; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|