设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12790|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ `9 d, X' ], n9 ?. w" P0 f) {$ F/ D$ ~/ M6 s# a" x
我的问题是,在每个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 K, w# V: Z  x$ Y, [4 c# C! I
1 X/ g, o( T9 E: Zbegin P_read arriving2 @! F4 m( ^: z7 B1 K
    while 1=1 do begin9 x3 H6 Q1 H% l/ Q
        read A_tote from "data.txt" with delimiter "\n"9 M1 D2 u7 ~, T
        read A_time from "data.txt" with delimiter "\n"
; A  A7 A& f% b3 z+ V2 z        read A_leave from "data.txt" with delimiter "\n"# h0 Q  w& a. Y5 r3 O
        read A_picks from "data.txt" with delimiter "\n"
9 s( |. t  o; Y, b- k8 e        set load type to A_tote
  L% l) W5 U+ O% s- ~        if A_tote="tote 1" then set A_induct to 13 S: u  n7 E& D
        else if A_tote="tote 2" then set A_induct to 22 W; D1 N, q8 @9 C0 b9 i0 v% s
            else set A_induct to 3   
$ N. _1 Y! Q9 l- L7 W. R$ F        set A_i to 0
2 e3 @7 _3 Q5 {( }: i        clone 1 load to P_induction
' V5 g: y8 a# j: ]5 g% g' h" F        wait for A_time sec0 ?$ ]+ I. _' W& Y7 z# H
    end
# }$ Z, S2 B$ W7 cend8 z7 A6 g" G9 E2 P) _
* }; {9 [7 }+ \- n3 `
begin P_induction arriving
; M0 G: a3 ~2 c7 T    if A_induct=1 then clone 1 load to P_pick1
5 x) q+ _8 h1 {( Q  y    else if A_induct=2 then clone 1 load to P_pick2
, C3 M2 W6 t; `& K) x        else clone 1 load to P_pick3
! {& m5 }8 M  mend
( S1 }. y/ P; ?& f; d2 C0 }) n4 d% b5 f: \: t
begin P_pick1 arriving& U* a" n  j7 v: V4 B+ T
    set A_i to 1
" ]$ B  N; ?& R4 g0 q5 f7 ^    move into Q_induct1
( v' y5 ]' J" B8 }7 H: o8 I    move into pickaisle.induct1: K9 h3 m* ?1 U6 O! @% S
    while A_i<=30 do begin, Q$ _2 S4 @0 U( a
        travel to pickaisle.con(A_i)* T2 V/ i5 b$ {4 }& V; d# n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 J5 y& a+ U+ x2 y0 H        else wait for 10 sec
/ G& h* o; H9 d1 _. x4 b        if A_i=A_leave then send to die
5 p/ k- ?7 ~1 L        else inc A_i by 1: i* |, E* i( |; d) Z
    end
$ _9 Q2 {4 N* ~' d2 y. Q  Kend
7 \0 k* v+ r, t; ?1 ?
7 ?2 w. V# X( R5 Xbegin P_pick2 arriving
1 D2 [7 i- S8 j" [( \8 m1 X. }! \    set A_i to 11
, t, Q. ~" u# c7 s    move into Q_induct2- i6 ~& m' ^9 D1 i2 s
    move into pickaisle.induct2
. O2 r) x' I1 V    while A_i<=30 do begin" e4 n2 ?% f( k7 w9 W1 U
        travel to pickaisle.con(A_i)1 H( x  |2 i) N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) P$ M: i  [% y& G' I4 w
        else wait for 10 sec& `8 P' ~$ X; a4 \
        if A_i=A_leave then send to die
; Z- e3 ]0 N; O; F3 n: u- o        else inc A_i by 1% O* m1 ?; h4 c! W
    end' }  ?- [; E4 ^* H9 [
end
) h0 {: {) d$ O6 a* i' v6 H
+ l1 t; J" q9 ~2 x2 Hbegin P_pick3 arriving
: V, S, ?( l6 y0 V$ g    set A_i to 21
$ I, U2 x& O7 E% I6 l$ x: F    move into Q_induct3- }) m: B8 U& J1 W5 a, z7 T
    move into pickaisle.induct3) B. s  ?1 N; \9 i" A
    while A_i<=30 do begin; ~) m# T3 ^# h1 p! G0 w( |! m
        travel to pickaisle.con(A_i)" f$ g5 e7 ^9 c  m7 q& O; H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c8 _7 {' R) A) B# t/ U        else wait for 10 sec* \$ j# t/ s( S; q& G% D
        if A_i=A_leave then send to die# f  w2 z+ Q) H7 Y, ?1 x7 V! i- Q
        else inc A_i by 1
0 J4 w0 j5 n4 n! o: t- A5 W* @8 {    end8 {, x! Z7 @, A1 a8 x& j
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是个什么东东?7 W( p3 d1 W* A( K1 t6 k: N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 `2 z0 a, R: X( E# S8 P

7 l. ^* @) a1 P0 @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' Y$ O8 |* N" c/ J8 i2 e) Q

/ e* Q% V1 s, z+ ~# k7 a7 @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; Q( R3 O0 a. k1 ]  ?! Y1 W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 }6 c; {) w  k+ Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' [) L, S, C' A9 C) p9 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& f7 p- W4 F* o( I  kbegin P_induction arriving" {5 i9 Y. a: b, c, S3 p' K
    clone 1 load to P_pick(A_induct)
' J; @) w1 j8 S8 R/ `: Xend最大的系6 P& d0 Z' \( }! j1 e; l. R: V

% q( Z( {  e: @( i2 {8 @  w) Kbegin P_pick arriving
7 u3 p, n; N( V+ J    set A_i to procindex * 10 + 15 m3 @, P. ?9 M) Z: }: d* L
    move into Q_induct(procindex)
4 Y+ b; E) O* `: V+ I    move into pickaisle.induct(procindex)' p1 ^1 H: {5 _4 v" [+ C/ T
    /*check the type of pickaisle.induct(i), for your last problem.*/6 U% q* k$ a+ Q% K

. _+ G4 R" f. D9 y5 B; t    while A_i<=30 do begin" \( G3 y" {8 k, [. r9 s  ?
        travel to pickaisle.con(A_i)
5 b8 w: H3 H% q) j9 h4 n5 c  J2 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; I) k$ {& q/ g! m8 k2 k        else wait for 10 sec: K; S% W, Z$ `3 C: Y8 |
        if A_i=A_leave then send to die
! _% W$ V4 c' a9 h% L1 G; Q        else inc A_i by 10 y2 S+ @+ h2 Q# |5 l# n
    end
3 e$ Z1 y2 L; H# J! Kend# b+ G$ W1 e# V  R, S  r% t
- J- j1 ~& E# x. B; ?
其中的procindex为整形,代表当前process的序号。  X- Y! Y6 ?! z6 x
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-2-21 05:36 , Processed in 0.026608 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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