设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15271|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 v6 P2 d# O, J+ [  w) Y, @! |' \
! b  j, M$ a" H0 m, `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& Y/ X; Y" l! T" i: F+ Y) ~# `: G, G$ o+ z' j* a6 A& H$ k
begin P_read arriving
7 I1 X3 e  u7 D2 E9 {0 s" C    while 1=1 do begin; K6 R( ?* C: k0 o* k+ Q
        read A_tote from "data.txt" with delimiter "\n"& L" E+ H4 F' K4 a/ V$ _3 h
        read A_time from "data.txt" with delimiter "\n"
6 u  i$ j. M# j- ~0 |* B        read A_leave from "data.txt" with delimiter "\n". I3 l" ^. Z3 Q9 t( Y( x( ]4 a
        read A_picks from "data.txt" with delimiter "\n"; C4 R' x& |+ y$ Z& I* z
        set load type to A_tote2 c* T) F8 W) `/ `
        if A_tote="tote 1" then set A_induct to 1
! \1 L4 n. R2 Y/ l  M        else if A_tote="tote 2" then set A_induct to 2: w& s; ?" ~' i
            else set A_induct to 3   
- ^: G$ \* ~1 f" c4 |7 a" X        set A_i to 0  p) E0 H: E$ t6 Y
        clone 1 load to P_induction/ y% u3 E0 N3 y7 ]* ]
        wait for A_time sec
: S5 d& E' [2 y' B3 O    end
5 p1 y  L" ?- [! @end
4 Y7 i2 _. W% b8 h/ w; W( |# F
3 k. H7 A( H. B: q+ [begin P_induction arriving" L# N; F4 g1 w4 P9 i5 ^
    if A_induct=1 then clone 1 load to P_pick1" x) m$ P# T4 S5 b
    else if A_induct=2 then clone 1 load to P_pick2  O6 ~7 D* d3 K0 \6 }4 {1 P
        else clone 1 load to P_pick3& g2 X' U  d1 i) Z6 y9 P
end
/ r& O  t  T) O3 G' r, D! D- E( a+ t' l8 |- S
begin P_pick1 arriving" P# P% Z& W# ]  a0 j
    set A_i to 1' X6 B( j+ p4 k, \/ u+ t) P0 J, \
    move into Q_induct1& B- F, I  m1 I, G: Y& D5 q
    move into pickaisle.induct1
% z) `! |& M2 @    while A_i<=30 do begin; S. A3 p% c& z( G) w) B5 {  M" g
        travel to pickaisle.con(A_i)
" a6 }- ]( l1 P7 {8 T2 D3 g8 S; c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" O" d% [/ M" _4 p- c6 C. ]        else wait for 10 sec
% E/ Q! l0 f* q! n+ @/ K        if A_i=A_leave then send to die! t( D$ u2 W7 U3 J5 @' K5 A
        else inc A_i by 1
( c: Z4 x! f- [' z9 g$ c7 ]    end
1 \/ d' q2 @8 U9 xend
) ]: f0 n) B0 F  Y- d( n# o% B. W
, Y/ \3 V3 U" m% L. s/ Mbegin P_pick2 arriving
2 q7 U6 J/ k: J6 @1 _) L, f( t; e    set A_i to 11
+ r. l5 e' Q: U5 w: q    move into Q_induct23 [5 |/ U8 O) u1 f" u/ g
    move into pickaisle.induct23 i8 n; s6 V- e# D7 v# H3 Q
    while A_i<=30 do begin: X' _, N) c2 o: S* f- n
        travel to pickaisle.con(A_i)# o3 b' a, n' |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! n2 d1 q* g( r
        else wait for 10 sec
, m, T7 D/ G! G        if A_i=A_leave then send to die% [2 u' D2 ^& _2 V8 R9 L% a, G" Q
        else inc A_i by 1
( ^+ C. r% B% d$ G    end. E7 d: W! L; ?
end
, X: k$ K+ F5 M2 f5 S; w' ^2 S2 x5 u  I3 b
begin P_pick3 arriving+ Y9 A( A1 c0 i( s
    set A_i to 21
. l3 G3 V* x+ E* w% s' U    move into Q_induct3( t/ m$ t" d, K0 K* G! P: G& G
    move into pickaisle.induct36 i$ |* k- }0 q1 M
    while A_i<=30 do begin+ n2 ^- D2 V5 d* T
        travel to pickaisle.con(A_i)+ p) K- Y0 f( u. ?4 O* x5 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: O) D: Q' h' `& v% f        else wait for 10 sec5 G! A: o; Y3 p: W4 V4 r
        if A_i=A_leave then send to die/ r: @# e$ B4 s- E
        else inc A_i by 1# L, I6 R$ Y" l0 p) ]- ]0 G$ |
    end
" Y. l+ E( o4 R/ u+ f! Rend

最佳答案

查看完整内容

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是个什么东东?
/ \/ C1 ~# E" w9 U: Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& K) A$ @  F, u' U1 @" N" b$ d) o

0 O/ U' {4 h' ?4 E0 DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! u1 V6 U. R" x
& c' w9 w+ n: Y. p( K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ a4 h$ V& \+ L& S* k; J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% \- K2 g7 M2 j4 T! ^6 n% F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ i; q8 z0 o- N$ r* k8 Q  u$ b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( b* n9 b2 X5 K$ ]5 g! I1 ubegin P_induction arriving) l) R( C$ r$ B1 n
    clone 1 load to P_pick(A_induct)
' F  e8 k4 C% _9 `% \$ oend最大的系
+ u8 E! H/ ]% Y- L- J# ?+ L+ t5 ~; o5 c, i5 \" i3 P" \9 n
begin P_pick arriving$ e/ t+ H/ d$ |, z' P6 H" W7 A
    set A_i to procindex * 10 + 1
# j& v1 ~7 W) s1 O* R7 y" X& p    move into Q_induct(procindex)( i3 s. ]* g1 c+ O; b; V; y
    move into pickaisle.induct(procindex)  ^7 I$ F- |" M3 A; u+ U  ]! M: p
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ j# e2 h, n* |. U& K/ ~( b& v! t6 t5 o+ v& E! K; y  H
    while A_i<=30 do begin
7 W' m" }* K# s4 g* v# [4 G        travel to pickaisle.con(A_i)8 L  I& r: N( g1 A* Z) [/ G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 A; ?# c2 d! r
        else wait for 10 sec
- ]8 a, A1 Z# W. [0 p) h        if A_i=A_leave then send to die% c1 v5 b  e% C+ Y+ Q, @
        else inc A_i by 1! F4 s" b8 H6 t. u# |8 b7 f5 N4 E
    end/ E" p4 W, h! t0 X
end) Z  p  @, X9 q
% W# Q+ p- e, H6 ^8 r, ^' S/ e8 H
其中的procindex为整形,代表当前process的序号。9 d; Y- Z& q7 q6 ^5 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-8-29 01:17 , Processed in 0.017469 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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