|
5仿真币
课程设计遇到问题,希望大家能解答,谢谢
3 w/ `: d+ ?, B) I- H7 ^1 ^3 Y4 ? y6 _- _9 O( q* c) {
题目是:假设有两个不同的东西small和large经过同一个singleProc,如何设置他们的pricess time不同?
6 J" \8 j/ T3 g: a& q8 `我的method是这样写的,但老是出错! p$ d% R% } n5 r9 q
is
1 E# N$ j- W, B+ _4 cdo
8 m& o7 r4 F5 Q8 m* V if @.name = "small" then% o3 G: w0 m. q8 X
singleProc.proctime :=1*60;
4 M! b& ~1 ^6 K0 u0 ]& d @.move(drain);
. x F% q3 N4 U$ F5 z. W/ A else
3 a( [' V+ L/ o) ^0 r. j singleProc.proctime :=10*60; 3 N: _+ Y7 @8 R' V- w& \
@.move(drain);
4 S6 F" a& q& m, h end;
& ?+ I9 a& q9 P0 h* H: t% ?) w9 \end; |
最佳答案
查看完整内容
你的问题在于没有真正了解proctime修改的是什么。
你的问题应该是当物件过来的时候根据entity类别修改proctime,而按照你的程序,你是在singleproc的exit的位置修改的proctime,这是不合理的,这个method至少应该放在singleproc的entry前。
提示(自己试一下比较好):
如果你的method是在singleproc的entry触发会有问题,因为触发method的entity的proctime是不会被修改的,warning:Warning in method '.Models.Frame4.Method' in ...
|