设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12372|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: A) @& ^$ V4 _5 O3 ?) ~$ G

# Q$ I# d8 s- Q( z$ D& m3 {7 [9 N我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
: l: U5 k8 r# K* g
3 l$ N( V5 H' N$ jbegin P_read arriving" W" V: R! y% I( S9 f
    while 1=1 do begin
, E7 F+ V6 B  x& F. c; Q" L        read A_tote from "data.txt" with delimiter "\n"- T( d+ d1 f7 h5 N* ]
        read A_time from "data.txt" with delimiter "\n"4 J8 |# m( }! {
        read A_leave from "data.txt" with delimiter "\n"
% {- h5 a6 N6 l+ s, J        read A_picks from "data.txt" with delimiter "\n"
  q: V. Q9 j( G/ D) ~        set load type to A_tote) K5 ?2 A% _1 t8 d5 v, i
        if A_tote="tote 1" then set A_induct to 1
) \6 p& y0 V! s8 J) n        else if A_tote="tote 2" then set A_induct to 2& O* x  }" b! A8 l7 N/ u) j* k
            else set A_induct to 3   
( `5 c- A8 ?, V5 j        set A_i to 0( z+ r* k$ h: P/ t8 K; ?) Z1 a+ y
        clone 1 load to P_induction
& _: ~, e6 ?) o* e7 ^        wait for A_time sec( H5 [: V# R  w
    end
+ g) W& \2 f- N5 b0 Aend. K& q* @3 p1 q9 u

! G. X" N5 Y9 c! d. j: p  rbegin P_induction arriving
$ O: H$ u5 G+ I1 s& I    if A_induct=1 then clone 1 load to P_pick11 ^( D% c" e& e2 N% e
    else if A_induct=2 then clone 1 load to P_pick27 I1 O2 y- C; ^* T) p3 Z
        else clone 1 load to P_pick3. |8 E* X, b: g6 \+ O; k
end4 b7 f) @9 M- n
% V: l% H+ ]+ ^3 V
begin P_pick1 arriving
- ^1 o& N$ i# j    set A_i to 1
2 w) g4 p* ^" ?5 P    move into Q_induct1
! y% G3 m: e; j4 I! x    move into pickaisle.induct1! I" ]# p% O8 K" Z. N* A1 K* S
    while A_i<=30 do begin
3 _0 ]- t, s# s: P        travel to pickaisle.con(A_i)
9 R! Z1 Q( j+ X3 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ `- D0 |+ b. P2 }
        else wait for 10 sec5 Y/ y& U' T7 v
        if A_i=A_leave then send to die' s" H$ H2 [) s1 d4 z
        else inc A_i by 19 H! s! w! o5 ^5 O
    end# R) K/ p, ~& F8 I% F, y6 k
end; S9 Q7 J9 T# }8 `
0 ^4 S/ K" c, P' f
begin P_pick2 arriving- B0 q$ ]% C) a: a% A
    set A_i to 11
* u( g- m+ q% r' \( T2 E    move into Q_induct2; E( _9 e5 h; L7 q# s, h
    move into pickaisle.induct2
5 u3 A7 |3 T, |! T: G    while A_i<=30 do begin7 u. E+ P, f) t: A3 ~8 M. I
        travel to pickaisle.con(A_i)$ U/ Y/ _: h) t$ p+ X: V4 a5 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! n$ y: C6 \: o" V, T- S7 A        else wait for 10 sec
/ S; M! A! s7 D) s& X/ U        if A_i=A_leave then send to die
  \( e" [6 V' E- L5 M3 q        else inc A_i by 1& j5 ~8 }7 z! O! ]$ R6 e
    end
) G" [: L, M! v7 C7 I" Q5 Zend( n9 C' z2 K% {4 R! {

* J) g* p' x4 e& v) dbegin P_pick3 arriving
1 h. l  \/ ~) f! G: p5 ^    set A_i to 21
1 G. X- Q( Q; [8 B+ Z2 s0 n    move into Q_induct3
/ G! G# ?" M9 N$ o) q9 r    move into pickaisle.induct3( @0 C6 C* c6 V) s( y
    while A_i<=30 do begin4 i. P1 N# h5 g
        travel to pickaisle.con(A_i)
) A5 h, G4 D! r9 E. n# P; e7 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% B6 @" P5 I4 \' j& ~% [9 M        else wait for 10 sec
( K- F. g6 Y1 J3 h, o        if A_i=A_leave then send to die3 x" r- c0 Q" z
        else inc A_i by 1
+ @& P- F# H+ i% o9 V8 P    end4 X6 a, a, |+ o; V; z) u' K
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?5 C5 |" z- x8 W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 h& ?, p0 P$ }1 W/ J1 f. u6 w: U/ m& l  t8 n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 x' [8 |( o1 H/ M2 d2 ^5 d

7 r  S' S6 |4 [. E4 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% a% E6 m8 [. z* |& H; |) K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 E! J0 a4 ~" Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% W5 p$ R7 I2 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' P& S/ Y. D; D  S3 u# s  c5 o
begin P_induction arriving9 |. `% A0 P" n' ~+ }4 J% K% s8 m
    clone 1 load to P_pick(A_induct)- ~* F0 [, X$ _
end最大的系! |  i2 n& o  a/ i
- Y: B% w* R/ i, \$ L: k) A
begin P_pick arriving
5 z) q# `% \( K3 R) I    set A_i to procindex * 10 + 1
! t+ R. ?2 b* h. l/ Z) ]    move into Q_induct(procindex). k7 Y! ^; C, g1 a* w
    move into pickaisle.induct(procindex), x) @/ e9 y7 S$ }; p
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 h, m9 d$ x; y9 p: o$ Z5 T7 L: @. S) y7 j; `
    while A_i<=30 do begin  j  P5 F. R- z) z2 e+ q. z8 e
        travel to pickaisle.con(A_i)
/ [1 b6 _  l, E" F- |8 _) D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* L* n0 o& H( Q: T
        else wait for 10 sec' l& e* k" ]& z' {) \- y* ~
        if A_i=A_leave then send to die# k( w, K) c  Q5 D: e' a4 v# S
        else inc A_i by 18 Y3 e2 j4 R* w. e9 W0 O9 y' x
    end! ?$ Q9 _7 ?7 A! P
end
' O* `( B* D8 N" z5 V
! y; l( R0 M) p2 Y$ k! R% X其中的procindex为整形,代表当前process的序号。
& j, X9 R) D$ g/ S0 B$ ~- fstation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-1-19 03:41 , Processed in 0.021525 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表