设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13841|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: F$ c8 U% Y$ b$ P1 I3 q. N1 m4 ~1 U: ^2 N- f4 K: p- L6 Q# 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中的数值,不知道会不会有什么不妥。
8 \' ?/ [( Q% c; I( k+ m* l9 A
- t, q. @# T1 G/ I; {* f& Lbegin P_read arriving
4 y" P5 ]8 ~# O( W5 e( e+ g; j0 M    while 1=1 do begin! M& N& |. T* s- v* F
        read A_tote from "data.txt" with delimiter "\n"+ o; o5 S, n8 R4 d, ^
        read A_time from "data.txt" with delimiter "\n"
( ^9 {! \9 j1 I; c        read A_leave from "data.txt" with delimiter "\n"4 ~: J/ L* o% H3 C/ l
        read A_picks from "data.txt" with delimiter "\n"
& Q/ ~3 O  D6 A        set load type to A_tote
0 [1 z- ]; M5 n0 Y6 \: F) l/ V8 i9 C        if A_tote="tote 1" then set A_induct to 1; Q: n( t9 Q2 [+ O
        else if A_tote="tote 2" then set A_induct to 26 a4 g( h* D4 H% f
            else set A_induct to 3   
5 h8 s, Q7 Q) U5 a  l0 o' A' Q        set A_i to 0$ P8 G% \) D# d# C/ k4 x+ D" R
        clone 1 load to P_induction5 q! u9 G  J- r6 }" D( y
        wait for A_time sec
; P1 S4 S: \, T1 H* V- x! q    end
# J4 E2 j7 [. Z$ ]" _( c$ jend  e8 K! r, }: Z1 L

: G6 d1 m1 {& Z* b4 I& M" v% ]) p9 rbegin P_induction arriving% x' m4 j$ v, j% T# Z4 w/ A9 w
    if A_induct=1 then clone 1 load to P_pick12 ~6 U- v* _, C" O
    else if A_induct=2 then clone 1 load to P_pick2
; @! Z; y+ y" u. N6 P        else clone 1 load to P_pick3* w; Z0 K8 [2 [) R: Z7 Q
end
4 W% q7 G% m+ U6 K5 \) M0 s; L3 g. ]) d% X
begin P_pick1 arriving
( b0 c$ Z5 P4 T- M    set A_i to 1
2 s4 d# v  O" \    move into Q_induct1
9 o: g: E7 Q7 v! O: u    move into pickaisle.induct1
( C8 ]* r, o5 g    while A_i<=30 do begin
4 I4 d* [9 C  x& K) j9 h5 G8 I        travel to pickaisle.con(A_i)% v* F9 x( X/ Y' c% l4 M+ b5 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 \% [4 g6 ]8 P
        else wait for 10 sec  E4 H/ }7 k; E# h7 i$ @; B
        if A_i=A_leave then send to die" ~6 D7 E6 ?- |( r- j) a( ]% F
        else inc A_i by 1
" s1 O4 ?. r5 S9 D2 L    end& B3 ?3 g2 o( }
end
; e: l! _& S4 s
# l/ B) v# F! ~0 o6 c0 r8 Q/ Tbegin P_pick2 arriving1 r3 m* Q* ^$ F3 b, H  ]1 y" z4 U
    set A_i to 11
( T+ m% y- c! O4 b% g1 I: J" r    move into Q_induct2
$ ]4 o3 h; b) J$ E" ]/ h    move into pickaisle.induct2
& o" U& p" Q& y. W    while A_i<=30 do begin
6 f2 Y* T& d  i5 m- A% U        travel to pickaisle.con(A_i)$ N/ J+ ?, p4 Y2 T; z- |3 S0 w7 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  E2 F9 B1 C. o4 ~0 U        else wait for 10 sec
0 Z# A* b0 Y: ]! \; z5 Q, f: d        if A_i=A_leave then send to die
; g  }8 |2 `/ e9 G4 z: p        else inc A_i by 1
. S# C1 ]8 V+ i9 W( l* i# f    end, y( y7 @4 s6 V8 @* A8 s
end
% ^5 O9 V  t9 K* S2 ]' s$ q) U4 L" j# R( g
begin P_pick3 arriving
- Y2 k$ L9 a. v9 r    set A_i to 21; i5 N; d8 R0 |5 N" _
    move into Q_induct3( ^4 b* K% `% J/ q) B
    move into pickaisle.induct3
- ?3 y4 J, V" Q3 e0 m    while A_i<=30 do begin# O1 Y) l  O0 F8 l# a/ D; |# H( D
        travel to pickaisle.con(A_i)
/ l5 t+ L* t- B& a3 q$ W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, |  B( i) R( n+ Q
        else wait for 10 sec# a7 ^9 P7 E4 D" j/ ~; u# _# e
        if A_i=A_leave then send to die
% O  j5 `6 p0 u6 a* `- E        else inc A_i by 1
+ `9 o# y: l) O    end2 p3 ]! x  K# A4 _) ~8 R
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是个什么东东?+ t4 M3 a' s5 }3 d, n) Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 d3 b' `3 i  M5 F2 F" ?  \$ z
; V# m6 h+ ~; C4 [. C# w1 E* h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 N! a9 w( W* Q& v* s9 ^2 I
% O5 d3 j5 f$ }+ e. u5 M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! G6 j3 }3 i# e" r+ A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 ^, m- d4 \4 d5 v$ `2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ M0 o3 _7 @' B9 t  [- Z6 Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  J+ ?# M, z2 o( O6 rbegin P_induction arriving$ A$ p6 u- {8 b+ p* u# a) J
    clone 1 load to P_pick(A_induct)2 x; i$ C1 ~1 M; o' w
end最大的系, E3 D$ I' i5 E4 j( L6 n  s

& V0 i& G$ s. C: y% U6 `begin P_pick arriving
9 X, H3 b5 X7 R! f) x    set A_i to procindex * 10 + 1
' {1 x, N* ?6 U9 H( X    move into Q_induct(procindex)! |/ [! x1 t# z" K, i" S7 D
    move into pickaisle.induct(procindex); W' i) l; X* B0 e( {7 Y+ C
    /*check the type of pickaisle.induct(i), for your last problem.*/
. ^7 @$ c( a$ V7 h
. ?- f% W# a% M7 K' @' C0 W    while A_i<=30 do begin
! B/ @) c0 e- R" U/ H6 @! U1 z        travel to pickaisle.con(A_i)
' L/ d+ I/ T$ Y; Q  R. L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ B+ K+ F$ x* [4 y6 l. n7 Y$ b        else wait for 10 sec
4 `9 [) d9 [. `1 H        if A_i=A_leave then send to die. [& Z! J" }, V, z+ q/ B8 T
        else inc A_i by 15 y' H4 r) r5 Z* x, s; K
    end; j7 q% T7 U' j) n
end
# _$ A4 Q6 }2 q, A9 e0 t
" ^2 E+ u- W% t+ y$ F5 y其中的procindex为整形,代表当前process的序号。
6 G% W0 G2 k) |) h9 _0 J* h9 Astation和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-5-11 14:33 , Processed in 0.019393 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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