|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
' l! b, q" _9 O( i# n& q, \% F& B- t6 [# i( E9 H
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
" d, c' L6 e- Y/ ]$ [我的method是这样写的,但老是出错!
. j# n( x- o9 [) ~1 ais. d5 i; H( O6 [5 n1 F
do 7 [, O; s) l5 B/ k8 j$ b
if @.name = "small" then2 A0 m( D x: K! s& A( s, [* U
singleProc.proctime :=1*60; - ~8 \7 ]4 s' d% u1 m" w
@.move(drain);
+ k, \) {# m0 z L4 }- T. b else4 F7 w3 j! z W6 u( {" l
singleProc.proctime :=10*60;
' r/ A' @8 m$ I* [' n+ z @.move(drain);# t5 y. _+ K/ Q. d) x
end;+ R N# R: G; e3 z
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|