设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15066|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ q3 ?# m. q6 r$ T# ?) r8 G! e7 e
0 q: F  T1 t9 j, Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ o( K4 ?& F/ l8 u. M
/ }3 b' X2 n' [( G6 W% Q+ `- A
begin P_read arriving
- [7 F+ f  J' h4 y    while 1=1 do begin6 I, U, l3 s. R/ x
        read A_tote from "data.txt" with delimiter "\n"
2 Q# [8 o) n9 s! j. I: Y. N        read A_time from "data.txt" with delimiter "\n"1 J; W/ A0 I, u. L
        read A_leave from "data.txt" with delimiter "\n"3 k. z8 K+ E( J) i# l; n
        read A_picks from "data.txt" with delimiter "\n"3 M/ f* Z# g$ v' [" B, V$ j
        set load type to A_tote% t* Z; Z. K$ m% o, O* V
        if A_tote="tote 1" then set A_induct to 1
- Z  T7 k" [1 x# [( F$ ?        else if A_tote="tote 2" then set A_induct to 2
) I, `& k- t( [9 D6 D3 o% `( Y! h6 e            else set A_induct to 3   
& e$ j* L: `/ b0 G+ }        set A_i to 04 ]6 u+ o( M  }$ Y. h8 F
        clone 1 load to P_induction
, z3 F1 ^9 e3 z+ M4 |% z        wait for A_time sec
+ D% ?% ~/ _/ z! x    end8 b- m3 e! u6 i
end
* u$ W8 w0 i. }* W
* i0 K! V- G  W; Nbegin P_induction arriving/ y1 Q9 y: D: [8 J
    if A_induct=1 then clone 1 load to P_pick1
. [2 M: s* O, j/ m# w    else if A_induct=2 then clone 1 load to P_pick2
9 M5 `7 g0 ?! c5 U" g        else clone 1 load to P_pick3
! Z: Z5 K. [3 ^0 O6 i  |end2 N! p) ?; y6 d) d/ Y- e2 B

; X0 {3 V* w1 h$ b# _begin P_pick1 arriving
7 g( i7 g+ a. z$ b3 v. L4 I1 }    set A_i to 1
7 f. N7 \8 A8 H& j1 z    move into Q_induct1
, F3 ?0 d0 u: e8 H* H    move into pickaisle.induct1
0 Y2 a" _, W6 T9 R* b2 O& U    while A_i<=30 do begin$ q+ j) l2 |- ?$ {, p
        travel to pickaisle.con(A_i)
" _/ n( @$ A3 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 p/ @" i9 k+ |) l" N/ d6 M+ g
        else wait for 10 sec
1 f% Y. ]( G+ F        if A_i=A_leave then send to die
/ u3 L, D' l1 x! ]; F        else inc A_i by 1( z( R. M/ d( Q& K7 n* L
    end4 h. W: I$ k0 J1 s: v' D
end/ e* z/ m( S/ S1 _
( L( c$ A: x2 k
begin P_pick2 arriving
- e4 r7 ^+ }2 E, j1 i: I( b    set A_i to 11
2 v. H' S* D- `& L$ B' {    move into Q_induct2
8 p, Z% J# U/ y    move into pickaisle.induct24 t0 d' K) J( D' v- `$ u
    while A_i<=30 do begin
. u  q% g' ?+ [0 Z' {# G        travel to pickaisle.con(A_i)) m6 y# t8 ^, i* E) v: R, w- \" J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* K7 y0 S! y! \5 ?9 c        else wait for 10 sec$ ?1 u0 j: t1 s4 s) l/ C5 n
        if A_i=A_leave then send to die! k2 _  x! S+ ?8 q5 {" r
        else inc A_i by 1! q6 g8 g2 C1 C; S7 K3 C; V* V
    end' z& P# y. ?# M/ E7 R5 F
end& Y1 S" q5 {) C- G5 K5 p2 L
+ j7 T. p8 _  L
begin P_pick3 arriving+ ]8 L5 [, m# c
    set A_i to 21! S. \1 e4 j1 Q* f, s+ n$ V. N
    move into Q_induct33 v* T" I* w4 }7 L" G7 A
    move into pickaisle.induct3
+ d, l; m# ^6 [& c; j8 g    while A_i<=30 do begin; [) I$ n: K/ c/ Q; \) q
        travel to pickaisle.con(A_i)/ k  }- I4 P2 t) P/ r' Y+ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 J- i2 P# J/ P+ z1 }
        else wait for 10 sec, F5 l% |$ w) x7 l  l5 S# v2 ?$ c
        if A_i=A_leave then send to die# C- @; N" a/ P
        else inc A_i by 15 u& G# q* j2 R
    end( O/ A1 B' v* a( e
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 J/ a  ^5 a/ l. i0 N' Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" b) c& ?8 _" I  A, c9 G

& \& x4 r, S  X) n8 g7 lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' g; }. y1 P$ |- l) c$ k, z- ^5 Y0 \
4 z0 Z$ T; x3 e% G; P! l$ l3 I另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% e$ c3 @2 O, L' b( E8 @
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* F0 A' _  k' }! T# U0 @2 e1 `8 u1 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ ]5 V( C1 M: P# Y. J$ T! m/ G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! m' T5 s( J4 ]9 k/ Ibegin P_induction arriving9 [0 `8 {3 ]9 F9 _; H( M3 B
    clone 1 load to P_pick(A_induct)- N- Z; r3 v/ Q6 o8 d/ G
end最大的系
5 ]% R4 w' d2 k1 g9 c, Q2 X! }( F. F8 e- F# N- L
begin P_pick arriving7 A0 _9 U2 T. ?+ M. k, B/ o% ^
    set A_i to procindex * 10 + 1
. L& `7 B1 @5 U" [; D    move into Q_induct(procindex)
9 y1 V' j) v3 L0 L' I. _$ `" @  j    move into pickaisle.induct(procindex)
5 I% a1 d# ^9 t* T9 _% b$ B    /*check the type of pickaisle.induct(i), for your last problem.*/$ j. U" ^& Q' B7 j( }
4 Q- M0 [! L' I! t, Y0 [
    while A_i<=30 do begin
6 k  d% y. [& V0 a) C* T1 }        travel to pickaisle.con(A_i)* g5 X  _& X' c; b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& `  M& z! {5 n' w. F
        else wait for 10 sec( H  `! w' ]3 [# V$ m  q
        if A_i=A_leave then send to die
* g' S0 K( u6 ^        else inc A_i by 1& x4 n7 l' U0 F- Y& B# Q( T
    end
& E+ E' S( q" rend
% `# o1 J! M! i
. ^6 [+ r- d% B% N) o其中的procindex为整形,代表当前process的序号。
& |: U$ y" m1 N) v5 q& zstation和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-8-7 14:59 , Processed in 0.012743 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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