设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15349|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  T  C7 R; \$ E! |0 c
1 ?. Q- H2 k, u% U3 g) 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中的数值,不知道会不会有什么不妥。- d9 V7 B' Y. c$ R9 @- i( e7 b

3 u  B4 L, Q  hbegin P_read arriving- C/ \% _# R% B# P
    while 1=1 do begin
. o1 C  `4 V; ]) w5 \        read A_tote from "data.txt" with delimiter "\n"+ h, n0 n6 Z2 Q3 C& W& u! S
        read A_time from "data.txt" with delimiter "\n"
; g% q1 A$ n# I$ V/ x3 w        read A_leave from "data.txt" with delimiter "\n"+ C* m/ W7 ?, g, z
        read A_picks from "data.txt" with delimiter "\n"
% \: N/ B  V" x; m( a  ?. K& l        set load type to A_tote
$ [4 a4 N  A2 a) O# v: @        if A_tote="tote 1" then set A_induct to 1
1 s9 l! K: O+ t$ Z. C        else if A_tote="tote 2" then set A_induct to 2
3 v0 v0 f7 s) V) K$ q* r$ x            else set A_induct to 3    ) I+ g- M% W1 d+ }0 I, V
        set A_i to 0& }# R" i5 ?' m; U- ?4 b
        clone 1 load to P_induction& a7 l: y# E+ G! G) f
        wait for A_time sec
! u5 a0 R1 z: O# S5 S    end
- M. N2 i5 a- a" yend
. u7 ?& Z* G; {- L5 `
  ^0 m& h: C) w4 F$ _2 i* l  `3 Ybegin P_induction arriving0 D) e9 j! l' o7 A) o. f
    if A_induct=1 then clone 1 load to P_pick1
' F7 H% P: p/ i. |5 H    else if A_induct=2 then clone 1 load to P_pick2
) P7 p3 j0 Z- T- R. n6 O$ e        else clone 1 load to P_pick3
' Z9 _% p/ {, V4 ^! r* P4 cend& Q/ ~  ]% C  t- K

3 c* A9 ^. {) _, C5 x9 abegin P_pick1 arriving
% ]% o5 R  D6 y    set A_i to 10 S! z) _3 ?# v# E, n  b" o
    move into Q_induct1
) S, i; x  w, Z0 x. n8 n    move into pickaisle.induct1
1 \" _% j$ \4 U8 W    while A_i<=30 do begin
( R2 J) k2 P  U. i        travel to pickaisle.con(A_i), g" N. ~5 z2 A5 C2 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# t4 }6 e  I6 \5 R' s
        else wait for 10 sec
8 K$ U8 o2 J* M- R8 s# G  Q        if A_i=A_leave then send to die* j4 B( ]$ e; u8 R
        else inc A_i by 11 j8 F# L/ T% g% ^
    end7 m1 C$ l- T. f; k$ F8 @
end  O& E9 y* {* I4 K5 H7 B/ A* e$ E7 ~6 L
9 v# z& q- v; c* s
begin P_pick2 arriving% K& }3 e' D* R* b+ E1 T
    set A_i to 113 h! u8 {: o5 }' g$ p
    move into Q_induct2
& y5 ?' d! y: x  s+ ^2 O/ o% d2 N0 h    move into pickaisle.induct2% p2 w. a. b' Y- ^$ M, d, h' `
    while A_i<=30 do begin: _' A8 D5 o8 I, a; [
        travel to pickaisle.con(A_i)% i+ E0 H5 L* a. \6 c+ x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- P9 f- q2 C7 o! t/ L3 \$ X1 Y- M        else wait for 10 sec1 y& V# k" @: o6 _# J1 R4 Y8 I
        if A_i=A_leave then send to die$ j7 l- E5 x/ b0 |5 U! V# {0 J
        else inc A_i by 1  ?3 l- X. J2 C# m! W# ~
    end
& F: x4 `7 w2 U- A9 Rend% O5 [) E  R0 L3 K: D% x
: m& p" r) v; ^* Y
begin P_pick3 arriving: w6 v8 p2 Y, T/ i$ z
    set A_i to 21' [8 P& ?# s4 j' t' j
    move into Q_induct3
0 x3 r* j8 c1 j    move into pickaisle.induct3
$ {! N7 a2 x& J7 \* ?4 |    while A_i<=30 do begin
0 ~' c* }7 q5 g) E6 @. P' k        travel to pickaisle.con(A_i)
' F" c; a. M& B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ F2 U: _+ D$ ?5 f
        else wait for 10 sec& V1 {' w  M3 l) V8 Y6 ]
        if A_i=A_leave then send to die# o& h1 ?/ L2 O* m/ Y
        else inc A_i by 16 }1 f8 r& ]3 u
    end9 b' F3 d. O+ r( |, |7 \) K
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是个什么东东?
) B" D1 H5 N  Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% J! t' [; }8 a, D! A
- g7 L/ L! t; a  j1 WAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 {: R7 A% `- ]# R7 ^
2 F* }. {6 y" t* D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! [2 A1 J" \: U  T" a  h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* w% J) x/ Z9 J. j9 b& b8 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ W7 _  s! H6 j* }( O1 Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, X1 I0 u/ Z7 D/ obegin P_induction arriving5 O/ T9 t, z1 O7 m- b1 x+ Z! ?* w
    clone 1 load to P_pick(A_induct)
" M* R& s8 x; _5 b; {$ c' S0 K$ Zend最大的系+ y( P6 g6 g( h3 \: n7 D" F
* s5 b- m* }* f' H2 ~& r/ h+ J
begin P_pick arriving
+ \+ o9 ?+ m9 _& ?. M; k* F    set A_i to procindex * 10 + 1
) B0 s3 l$ y* y( F    move into Q_induct(procindex)
4 @  q2 W$ j9 d* n* ]2 v9 }, W% P+ z) r    move into pickaisle.induct(procindex)- T5 O' C- r: P
    /*check the type of pickaisle.induct(i), for your last problem.*/8 @8 d, X: ]7 W: P* T0 }
: y- J1 s" |6 p- T- ?* \4 i
    while A_i<=30 do begin7 v9 Q' K, }' y; ]4 b' `% @
        travel to pickaisle.con(A_i)6 v' |+ I2 b  N( i9 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, _1 K/ Z1 X" s
        else wait for 10 sec
; J- R# I3 t; h% n        if A_i=A_leave then send to die+ \% J8 R) k5 a3 Z* D6 z
        else inc A_i by 1, Z+ O- h6 o7 z5 D' f7 K
    end0 _4 Z7 j$ K+ y, J* t
end
7 D# m" w' ~9 n1 ^& ~/ f+ h5 ~$ r% u
其中的procindex为整形,代表当前process的序号。
9 ]1 }- h& D) H: kstation和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-9-4 03:39 , Processed in 0.015906 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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