设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14048|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ I% z8 a8 i% J7 k* Y( E, @: {' U, u+ e$ K, O' z+ \& m+ u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 r) U6 R# N& y- O- S8 k

: G" p2 M1 u! I1 y6 xbegin P_read arriving
% ]# p2 q) m' e% D    while 1=1 do begin
, B# F# F* A0 M* L/ e        read A_tote from "data.txt" with delimiter "\n"; w+ j$ x( t  G; t2 l
        read A_time from "data.txt" with delimiter "\n"7 _7 S' W7 o4 s% {: `' F
        read A_leave from "data.txt" with delimiter "\n"
) o: j9 R0 i* }( ?        read A_picks from "data.txt" with delimiter "\n"
: y- Q7 z2 X+ h        set load type to A_tote2 C. ~: k  W' G) o% w6 Y
        if A_tote="tote 1" then set A_induct to 1
7 h2 v0 c  i& c        else if A_tote="tote 2" then set A_induct to 2
3 B; @) a+ _# x4 R) R7 r& V            else set A_induct to 3    : s& K7 i3 j* ]: ?% `+ i
        set A_i to 0+ |1 y) N% C- p% O) O. J
        clone 1 load to P_induction
) B9 h& Y/ a2 l1 K' t/ P        wait for A_time sec
. J  s/ r- X3 g  ~. W- |    end0 K/ M* B" ~$ \8 W1 m
end
8 J0 @0 Y. J/ T* S
# \8 \9 O9 o, ^/ R, ]% Q% dbegin P_induction arriving' d. ]& ]+ E) }" E$ E6 y
    if A_induct=1 then clone 1 load to P_pick1
0 C/ ~7 Q: _9 U/ }) Y6 J( z    else if A_induct=2 then clone 1 load to P_pick2. ~) O* y9 S- W! M6 u7 L
        else clone 1 load to P_pick32 I0 |$ G% b9 X, z
end
9 ^$ `) f* R2 L& |1 a! v' A6 W0 E) o
begin P_pick1 arriving
) e+ I3 |5 b) A" Z% b& l    set A_i to 18 @* \2 t" H/ r0 x: S, W- I/ e: X
    move into Q_induct1
* D. e( x/ ]  R: G1 n    move into pickaisle.induct1
7 W/ N, @; r  k. N! \  w: _: i    while A_i<=30 do begin5 a* F2 o5 A# Y2 K7 Z
        travel to pickaisle.con(A_i)* E1 p' `- s: g0 T# P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 r" I5 K; N+ q1 A        else wait for 10 sec& j. O2 v; }4 J& B  H* q0 X
        if A_i=A_leave then send to die
5 _7 k6 M9 R% H1 D7 t" [) U6 s        else inc A_i by 1- x8 o- o! n, a* b0 P, e
    end
: l. n7 H, M) W: o( Y) send: z( n1 l* Z$ K! e7 o& `3 p

  t0 F( E! d# }2 B5 O4 t. n" X7 Jbegin P_pick2 arriving  d# C9 q1 @) I' m7 r! `1 _
    set A_i to 112 P8 U, K: K( F3 J' C( t
    move into Q_induct22 [* Y! _  @, m6 u: @2 x8 S4 i) {' ?
    move into pickaisle.induct2
# |0 O$ g8 N0 Y2 p; n: o    while A_i<=30 do begin
5 ~. C# X) P* `/ t$ R        travel to pickaisle.con(A_i)( Z/ r3 m% B) u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% |& T* C$ }4 R: w$ ~3 i8 v
        else wait for 10 sec$ U7 {, F/ [3 f6 i
        if A_i=A_leave then send to die3 [0 r. t' T. t' Q/ A( i" ^0 [7 X
        else inc A_i by 1
& A( K, q* [6 K. e; f1 @0 z    end3 _& p) j, ]* V" \: U
end
  C( v: r3 A: y  w' `5 m9 d' |8 w: I" L/ P
begin P_pick3 arriving: \) M9 V  Z, M3 |7 x6 v3 a3 L: s
    set A_i to 215 [7 L& O( a1 z+ \6 E# K/ ]  I1 D
    move into Q_induct3: m; `8 s& {* ^8 J/ G
    move into pickaisle.induct33 J+ q( s& I& l0 c* ^5 R
    while A_i<=30 do begin
* z3 ~9 u) Z9 h: U8 |7 |; \8 Q: f7 \  [        travel to pickaisle.con(A_i)/ a' e4 e' v; `6 s1 l$ r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. A9 u" O- y( I: |" g* q: f" b# j
        else wait for 10 sec0 J/ j3 K8 \. [. s6 q$ }
        if A_i=A_leave then send to die3 F+ u8 Z9 W- n5 f
        else inc A_i by 1
8 a, I, Y  C' R  l5 @    end3 M: }0 D% o7 m8 P) y
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是个什么东东?
8 _. L# M$ ~  |1 z8 a" n" \6 Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 ?! W, Q/ }% Q2 G9 `: v9 p& @* p7 M9 w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 v  [; \  N9 Y; Q0 f3 ^2 t, x6 u8 k0 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! l# D$ F; Y6 A2 z! V3 {" `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: g/ }2 J+ B$ j) n. K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* n$ c8 ]( C0 w1 J) o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  ]" E, A3 {+ w! \9 ibegin P_induction arriving
/ n3 s* D9 j3 G( G- B    clone 1 load to P_pick(A_induct)
* K$ c" s, x0 z2 l# Dend最大的系6 t! X$ Q  E  p

" _: z4 V" Q; w( T- ybegin P_pick arriving
9 Q8 j/ J6 }- i& }0 a/ v    set A_i to procindex * 10 + 1
; P& z0 W5 d, W$ X5 O" a. l* f    move into Q_induct(procindex)+ g1 T! m) P, i) `, x. @. A
    move into pickaisle.induct(procindex)  b5 b1 f; e6 C7 l% n+ b
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ y2 `: F4 Z* r/ h0 ~
5 t# E+ p8 ~& G- G  }) U    while A_i<=30 do begin
0 ?4 C! i7 I) g' q4 q' }        travel to pickaisle.con(A_i)0 `/ h0 B% Z3 }$ f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ~5 g7 }" \+ _2 Y5 e8 n4 Z" ^        else wait for 10 sec
, s. Z6 n# v. g- [5 k        if A_i=A_leave then send to die
$ |5 Q+ V( c) v% n7 m! R        else inc A_i by 1
6 [" t1 |3 o8 N    end4 b) u) K7 Q8 V1 {1 p3 e6 [$ q
end- A2 K0 n- C+ G, _2 \; a
8 E6 V6 O! t$ n7 @
其中的procindex为整形,代表当前process的序号。. h0 L/ t' F, }' c, t
station和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-6-3 10:16 , Processed in 0.016300 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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