设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14454|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, L$ L9 C9 S3 }% k
3 y! V" {3 z% z4 H* A# s, o1 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中的数值,不知道会不会有什么不妥。
1 o  i, `% a2 D' L! E( U. s, ], c2 l0 D1 G% [
begin P_read arriving
* s% t9 s, O' L9 x# I8 \! C& ]/ }    while 1=1 do begin8 U% v$ Q0 F, W. }6 w( H% p( J  @
        read A_tote from "data.txt" with delimiter "\n"+ ?; g: j) f8 s; a4 q) e6 x
        read A_time from "data.txt" with delimiter "\n"
1 G; C/ f* @- I" r9 @6 Q8 J        read A_leave from "data.txt" with delimiter "\n"$ w2 B2 y4 ?, {3 V1 Q, D
        read A_picks from "data.txt" with delimiter "\n"5 U. [+ Z4 b' p1 ]6 V: `5 O
        set load type to A_tote
8 J; L, N; H9 u1 J        if A_tote="tote 1" then set A_induct to 1' Z7 d# P3 }0 P5 b& n0 x* \
        else if A_tote="tote 2" then set A_induct to 2% q9 c6 O$ K- ]) I/ |7 t9 P9 Y# H
            else set A_induct to 3    - c% ^+ {+ j/ b" @% ^
        set A_i to 0
! B& O! a1 l& X, {9 m" C' K; w, ?        clone 1 load to P_induction9 J3 N- T5 d  E- H
        wait for A_time sec7 q4 t9 v* n* s+ X; W* j, [
    end% g1 ^8 D/ W. t
end) n: [" E6 t0 J# D
! M6 M# j) d9 o+ O; |, {5 Q1 W
begin P_induction arriving
& T# C# J6 F  g    if A_induct=1 then clone 1 load to P_pick1
  A6 t# ^7 a: i% ^5 ?  n9 j    else if A_induct=2 then clone 1 load to P_pick2$ e6 o( y+ d+ v# _
        else clone 1 load to P_pick39 [/ W" _  J3 ^! x# U+ y
end
3 d- U2 q5 l4 W  _3 F6 b
. j* v$ n) c+ N( xbegin P_pick1 arriving' j9 {7 K2 B3 }; K
    set A_i to 1
4 I) L& o: n( B    move into Q_induct17 x  N2 r; U: z: R
    move into pickaisle.induct1+ u9 S# t0 a" l. w9 U8 H
    while A_i<=30 do begin* Y9 c/ \- |2 j* g$ L0 c& H4 d
        travel to pickaisle.con(A_i)0 ^4 a/ r6 U" L% x8 R  i! U+ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 n7 ^9 i/ @1 p$ p0 v- Y- P1 p2 _- G        else wait for 10 sec& {: m4 T; b8 p9 ~& S
        if A_i=A_leave then send to die' L  l* d* j1 N' z, |
        else inc A_i by 1
4 d  z/ H" v( c, h3 |    end
* V. E8 |5 q5 i, V1 uend
0 ^! e1 V! A0 B. }8 L. d2 R. E4 j7 g, E! t' }5 z" s
begin P_pick2 arriving
/ Z+ X# Z$ H- u! Y    set A_i to 11
% n6 U' {2 x- W    move into Q_induct2/ r8 Y* k& `" h% V) y
    move into pickaisle.induct2
/ |! q) y/ G/ K# @5 \    while A_i<=30 do begin1 R; ]3 J3 P: \& R. Y
        travel to pickaisle.con(A_i)
- \/ b3 x( U0 L& v$ @9 O3 z8 t! o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, m7 @- |- t: s8 w5 ^' r$ j$ O
        else wait for 10 sec& w' J% e3 i8 g: o
        if A_i=A_leave then send to die; Z4 Q- g& B& ^
        else inc A_i by 1
! C+ T7 S1 s; H# e, w& p8 a- c+ j    end' W- G' S& X+ N
end
1 K2 m, M( S( T5 s+ r+ Y7 a, }
# {: S+ n( D+ K& c/ ^: Rbegin P_pick3 arriving) b) ?6 i5 Y2 e5 J- O
    set A_i to 21* e8 d1 _7 }* L* d9 }3 K
    move into Q_induct3
4 w7 w4 I) H1 J# M2 L    move into pickaisle.induct3
  j3 H0 v+ ]2 J5 E) I7 n    while A_i<=30 do begin% l: m$ p! T* n9 U2 S  h6 ?
        travel to pickaisle.con(A_i)
7 j  K3 H5 v0 C0 {* I" `; [3 x* B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" U# ?+ |3 g1 M3 h, `# K. z( U& p
        else wait for 10 sec
! p) L3 [! l0 n+ F1 |        if A_i=A_leave then send to die
% p( w2 `5 S. R        else inc A_i by 19 I! u5 q: h9 @. y) y6 Y" P
    end
. P3 p5 h/ _7 ?; w5 A6 N, Hend

最佳答案

查看完整内容

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是个什么东东?
  c0 J+ Z6 W/ K. imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, o6 S; U5 H# q8 Y+ \% {8 v* H' s
1 ^7 {+ S. j: a& N* _- n2 W  vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ V+ j+ @6 V2 C: N' R6 A/ f

4 a( E/ A- ^* J9 t6 n5 V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* A" {. q$ F( b( ^7 C; O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 j4 O) c& R3 J# L. q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! I) R8 `; ?2 B2 u/ p- ?7 J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ d2 [! M, }9 Ibegin P_induction arriving
" Z8 ^# h9 B* K8 u+ b1 A    clone 1 load to P_pick(A_induct)
) g) s) \: J4 ~# J- K, e$ y, n8 R2 Qend最大的系* Z% a3 k7 i3 [* Z  h
8 s4 J: a( d3 Y6 F- o1 X5 x4 G
begin P_pick arriving6 z2 S) }: X3 T( V3 ]8 r4 t2 b  K
    set A_i to procindex * 10 + 17 b+ G% c/ }- d( C$ h9 _
    move into Q_induct(procindex)4 r+ g* T; ?8 @6 V4 V. e- a
    move into pickaisle.induct(procindex)9 e0 K. h2 p' B% P/ T* I
    /*check the type of pickaisle.induct(i), for your last problem.*/1 B8 D' g+ T' D9 O8 V

- h( g) x5 `% V  a* {    while A_i<=30 do begin" i( C% u; Y3 f7 |
        travel to pickaisle.con(A_i)
, J, I9 N7 w8 T$ L' U7 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! m6 K+ D# h0 d* \$ l' H        else wait for 10 sec
% ?: C3 G1 J, `3 b7 J/ Y        if A_i=A_leave then send to die" I0 F5 X5 W* N' Z
        else inc A_i by 1. A/ ?9 H6 e8 T  q' {# P( y7 r% R
    end' e% g9 {' i9 X& G( V* n: ~
end
5 k8 l/ ^8 h2 Q5 D* z& C+ @- T0 s' T. k; }+ {* r8 o
其中的procindex为整形,代表当前process的序号。; z. _! C. i9 A" o
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-7-12 01:45 , Processed in 0.018640 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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