|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢8 @" [! N: v: t4 m4 H1 I- {: i
% A# }2 v" z/ M, O
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?$ ~5 O7 ?, w; K6 j
我的method是这样写的,但老是出错!5 M5 ~4 i: d7 S+ z" [2 e/ Y9 ?
is
' ^( \6 S) Y; q3 Zdo
4 F$ @' @ A$ \ if @.name = "small" then/ M0 |! {9 B; e
singleProc.proctime :=1*60;
! P/ [, ?: \2 g @.move(drain);
2 q* Q# v( X0 @4 A0 ? else; F% U/ u- j/ I9 N @
singleProc.proctime :=10*60; : v+ ^% ^1 N& |' [6 b- Q
@.move(drain);2 t7 r! H# `/ s9 Y6 T" [+ T1 [
end;5 Y# w1 a( A0 U
end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|