|
|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
2 a- n! N* H# U: J# @ e& H8 I( u, [4 y; h2 h
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?1 `, _2 p4 t) _0 O# ]* b3 h
我的method是这样写的,但老是出错!
* X0 S& j$ a- x1 K8 S' B' Nis# Z( ]+ Z' {! S3 l8 c$ @
do 5 z. }" E* B9 g2 J8 }4 C6 n/ B
if @.name = "small" then
% m9 A$ B' E9 }9 W( F4 }! G singleProc.proctime :=1*60; 8 D- k0 j& n5 @+ i, |; a& p J2 F6 h
@.move(drain);- g7 f9 l# K* S) L2 m
else& T& X, Q4 ?8 t0 v! f
singleProc.proctime :=10*60;
* K3 j( [- B0 z* G @.move(drain);
( q6 R( y# r2 m! l' L end;
" r8 e# L8 K8 W) send; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|