|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢0 u* t9 n; Y6 m
) n N# a3 S" s' f8 N题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
! e7 t) u( ]3 e9 M, D我的method是这样写的,但老是出错!
# _5 C( G( A9 F) ]* ^( A2 wis1 g/ C z& c5 O) s7 Q1 }
do
8 l- Y; @$ ~" W! E D e' D5 e2 @. ` if @.name = "small" then9 J3 ?- [5 W3 f& C( H( n
singleProc.proctime :=1*60; / u4 ^% p) p5 s0 R
@.move(drain);6 L, t; O% x9 {& O0 h4 L
else
* U# S/ t- h2 n: F: L# i singleProc.proctime :=10*60;
6 w% D) b; x5 Y9 s @.move(drain);
, ?4 y5 s) i$ U, w end;0 h$ K) p. f9 G3 I+ C- t B
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|