设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13672|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 g/ s( X- X4 E+ U8 Z

' f6 _7 U& _* ?7 U- @& B* I+ g我的问题是,在每个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中的数值,不知道会不会有什么不妥。' F9 Q" ]0 ^) @( T/ `
/ n$ A6 G& Y; Q& T
begin P_read arriving4 o! I) W+ b% B) U( C$ |, ^
    while 1=1 do begin
0 c' R+ L( j/ s0 b3 Z: M! ?        read A_tote from "data.txt" with delimiter "\n"
" t/ u( A- \  Y8 f8 {* G) e3 S4 H        read A_time from "data.txt" with delimiter "\n"7 e3 s, x- ^( m# N
        read A_leave from "data.txt" with delimiter "\n". {& q3 V: ~+ P1 x' W' N4 u
        read A_picks from "data.txt" with delimiter "\n", \/ _6 Q# k5 ]  r: y) o* B
        set load type to A_tote
5 L  Y/ J- }, A        if A_tote="tote 1" then set A_induct to 1
# t5 `! r5 L9 D* _6 r# w0 r. z  {7 V        else if A_tote="tote 2" then set A_induct to 2
+ O1 {2 o: i+ d' F2 ~) @' Q            else set A_induct to 3   
# C$ f$ }* x0 o9 R( ?        set A_i to 05 l/ u2 }' V& _+ k5 d: m
        clone 1 load to P_induction
- A8 e6 V$ t" e- [1 L        wait for A_time sec
* a1 b! y* T6 f5 L5 k, }8 i    end
$ p+ w8 H' c& B, bend
& M7 {* y) c2 R" }: t% O8 K+ y0 V# A: H/ K" Q
begin P_induction arriving" ]% r* T- [: U# ^( x' W
    if A_induct=1 then clone 1 load to P_pick1
. k2 O5 i6 e* p7 B# L    else if A_induct=2 then clone 1 load to P_pick2& @5 }( u( r" ^0 t' w. l( k
        else clone 1 load to P_pick3
" y) y5 ?" R) N9 K. l9 `; k  Aend7 G! _7 `4 }$ h" }; a6 Q6 [% U
% f  `* n9 n/ C  ^/ r
begin P_pick1 arriving
9 O+ f# \  l# q2 f5 `, C6 \    set A_i to 1
7 C0 }' _" H$ x3 M* n  A# |2 e# `    move into Q_induct1$ y' `% }' H! K7 |6 @4 @
    move into pickaisle.induct1
& V3 {  z  o; k5 ]    while A_i<=30 do begin
& y% w9 |6 t2 F( o9 n* c2 l        travel to pickaisle.con(A_i)& d. ^; E$ a1 z4 F- O" g% N+ P" t5 ?3 {( [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 @) f+ R% [0 A! @  ]
        else wait for 10 sec8 i$ w, ?( v% h3 f1 ]  B1 R& T
        if A_i=A_leave then send to die
$ K0 t2 ]& D1 ]/ ?9 c7 f8 L        else inc A_i by 1* _" [! V* J7 q7 ^4 g8 N/ \  ~2 N
    end
9 S3 D% J+ f7 Y3 i0 D' a0 ]end
3 ]0 x  p# t2 s' q2 X
1 P, i7 R$ J% E  x  }; y% Cbegin P_pick2 arriving$ U& W9 K9 I5 s5 `3 R( ]* c
    set A_i to 11
2 `7 S' W+ t1 Z$ @' O( m    move into Q_induct2
* Z' I: Y1 K; t9 ?0 ^    move into pickaisle.induct2. \5 G- d* _+ C  O* ]6 _6 D
    while A_i<=30 do begin+ q! L' @! E4 V: D7 f7 y
        travel to pickaisle.con(A_i)' r4 A9 G- _$ [9 ^. Z/ _. _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! f5 Z  }! Q4 X. r' V7 t$ {
        else wait for 10 sec- p2 F9 U; w/ z
        if A_i=A_leave then send to die/ J# H4 `  h# s* W  ?( C; a$ @- I
        else inc A_i by 16 n1 _% i4 z! e/ t
    end
; }5 P9 h: p1 |& v- Z$ T8 f) mend! L. |$ I# U2 ]) j' h
" G, z: y- X2 r; A3 b% {* D
begin P_pick3 arriving+ {- z# z8 _/ ~& n/ u: p, m0 y
    set A_i to 21
  Q, E; F- z+ C    move into Q_induct30 K- X5 g6 }8 q
    move into pickaisle.induct3
# \( c+ g+ _7 U* d1 ^+ V    while A_i<=30 do begin9 ^) T4 m, L& U# x. z; h
        travel to pickaisle.con(A_i)
  B  v# N' T, l2 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 [( O( s0 T" l3 n        else wait for 10 sec( N% ]/ V8 j! o" {8 Z" j4 K7 ?/ m3 A, r
        if A_i=A_leave then send to die0 o( v1 p3 U( V6 B1 Q$ n& o
        else inc A_i by 1
; S. e% {: |3 L, e: t" S( c    end$ U2 |$ q) v. m+ B: a% o
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是个什么东东?$ t7 w2 G# @+ c5 }/ S1 j0 \. L! y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ l, c  I: r5 B) I

) k1 Y% |# S/ h: `% M4 ]0 s: DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 i1 t% Y# C1 ^' x8 y$ l8 V

6 ^9 R" a7 v3 @$ k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* F- P2 D6 P7 l/ G/ P$ X) o- c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ E9 y; _/ z6 y6 u( f5 i+ C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% x; U9 b  B" U. Y4 c. U' ]! c# W4 W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) H2 ?. f+ a6 m
begin P_induction arriving* O% N0 d2 f' u: B
    clone 1 load to P_pick(A_induct)
5 w8 B7 I. }  }2 v( [, hend最大的系
  U/ {' J" i- o+ u2 ~. J1 p+ K3 M: S. s8 G: S' C, R
begin P_pick arriving5 Z: ~! z  U2 ], J0 w; d
    set A_i to procindex * 10 + 1
! o0 M; {8 s1 ?# @    move into Q_induct(procindex), g$ D0 T8 N8 v+ S4 D# C9 W6 n
    move into pickaisle.induct(procindex)2 M% o( J3 {" \) K$ U1 Z& e
    /*check the type of pickaisle.induct(i), for your last problem.*/) n( g- T* l, }% |  p" }
# T8 @" D! D# L" J
    while A_i<=30 do begin8 g4 I: h* O2 _6 ~  P! W! T) o
        travel to pickaisle.con(A_i)
/ r  ?1 M$ m) |" g; J' F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 M) x6 n; b+ }, g$ [1 d        else wait for 10 sec, K( j& l+ O6 H5 a6 L( S
        if A_i=A_leave then send to die
/ v9 Q! y0 f1 O% W        else inc A_i by 1
4 E9 Y, k; c0 l* ~5 J1 T8 [/ D* ]- D    end
" l1 h1 S, y+ a% ?( [( u- H8 ^, kend) ^( h, m8 Y" U" Z1 E# E
  n/ p  }9 N0 q! T
其中的procindex为整形,代表当前process的序号。
* E% |8 U5 p0 t( R9 ]( d5 cstation和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-4-28 01:57 , Processed in 0.020102 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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