设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12319|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ @& s1 q; Q5 y6 F. ]) m

- [1 R' z  e) S, C- ^9 c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ i" g: A) h) T( h- n- I+ V3 j4 }5 Y& X
begin P_read arriving
' U5 l" V( ^/ B5 P) G, A3 c    while 1=1 do begin5 q2 I& L* M  U) K9 L1 Z- {
        read A_tote from "data.txt" with delimiter "\n"5 R# p2 f" D$ h* h
        read A_time from "data.txt" with delimiter "\n"% y  Q2 Q% l# a( n8 Y8 a# |" k3 p
        read A_leave from "data.txt" with delimiter "\n"
# _' Y0 v- Q  x( F4 a1 T) g        read A_picks from "data.txt" with delimiter "\n"5 x4 M" w5 A# H
        set load type to A_tote
( @: \' c$ k% ~! N/ o  E; L        if A_tote="tote 1" then set A_induct to 1
2 Z) ]  S- u. t# t1 N        else if A_tote="tote 2" then set A_induct to 2' |% d8 q6 J' z) G
            else set A_induct to 3   
1 v2 _2 q9 j+ x9 C. g  X        set A_i to 04 [# C/ E! Q. M9 ]. Y" K
        clone 1 load to P_induction7 [; U5 i5 v1 {: [
        wait for A_time sec
/ H9 K+ J2 b( ~" e    end
  P  S% l% H; rend
4 S" M) b8 X% R+ q: E2 @6 f
2 N5 D! H/ x( d# T" ~# `begin P_induction arriving
5 R* ?$ ^+ V0 i2 a, v2 H    if A_induct=1 then clone 1 load to P_pick1
' A5 M! m) u( E- o$ O3 I" \, |    else if A_induct=2 then clone 1 load to P_pick2+ k' X" k- a9 D
        else clone 1 load to P_pick3& X9 v1 ~) x. D' ^5 n( K
end! I1 r) M. o* R  P/ W' a
8 U" `: o4 F* P4 f6 x* t
begin P_pick1 arriving% C* P6 k. i5 E5 N: H, b
    set A_i to 1$ n+ {, A9 d' X3 P( D, n( P& ]
    move into Q_induct1* v8 Y  Y& Y$ J" w# p" j
    move into pickaisle.induct1) U& e6 s. W* |6 K4 b+ H/ b
    while A_i<=30 do begin
" F1 |, N8 H1 q- c8 h1 G        travel to pickaisle.con(A_i)
2 D; v$ L7 W, Y: N, `6 z, x2 N& m/ p2 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 S8 B0 l( U" i! T$ K) a8 ]
        else wait for 10 sec3 u5 |4 K* Y1 ]
        if A_i=A_leave then send to die2 I+ V( Y5 `, ?9 o! y  J
        else inc A_i by 1. l* g. }! ^+ x' S4 h  w
    end5 e, W# w/ l- n
end0 J5 p, V' f4 B" C7 h. j
2 u4 f. M$ J$ e+ b0 g) N% v4 ]6 J
begin P_pick2 arriving& S1 `+ a6 V! n
    set A_i to 11. R7 o2 W. S% Z1 o$ J
    move into Q_induct2
: X$ u1 j( f" s; z5 t    move into pickaisle.induct2+ s  X! F2 x  C  B" s( |9 F' ~. J% ~
    while A_i<=30 do begin7 s6 G) w0 a1 |3 D
        travel to pickaisle.con(A_i)2 `/ e& s% v5 ^8 _" [; Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 r8 P% ?: {/ V3 `. R8 e) U) M, l" a        else wait for 10 sec3 a5 ]& W8 O2 C. X" M
        if A_i=A_leave then send to die
% ]" ]: T+ l" F) ?! u) `        else inc A_i by 15 ~3 v+ i: H$ y
    end7 {( g. x# G) y, [4 v/ A, |! v
end
( e% v7 r4 I1 z+ a1 S
) T+ N7 Y: d, f" w8 Y, ?4 mbegin P_pick3 arriving
5 u5 }0 t: \. J  }6 a    set A_i to 21
" \) J/ `, W/ {/ H    move into Q_induct3* G& _0 A+ `: @2 h; P& V
    move into pickaisle.induct3; n3 d' {. o4 W' K
    while A_i<=30 do begin8 l/ [# K1 O% p: s1 S: _* b9 [
        travel to pickaisle.con(A_i)
8 ~+ A+ R" J' O: N, J7 B* ^! F2 t* {) a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 d  p  \( s/ A        else wait for 10 sec
9 p4 e: y; e  X' }' Y$ \        if A_i=A_leave then send to die9 X' K# E# s2 Q# N8 S+ |8 G
        else inc A_i by 11 ?( c& b# h) E  r% _# G" ]4 j- j7 ^
    end
: ]& f  ?* F7 W# u! bend

最佳答案

查看完整内容

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是个什么东东?
/ T9 W+ k  m" Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 ?5 K. Z8 d- g$ X
# o& l8 {7 ]6 w) Y9 cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) O5 p# A  ~* @+ w8 d8 ]
5 e8 H' J: w  }1 z3 M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( O) N+ }; }- V: |8 |4 y* a1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! @# F5 m3 }3 ^- z: ]" y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 w9 ]" i3 t9 x! l. c$ l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 S! }# ?: n- J! o& x, P; J* l/ z6 I* lbegin P_induction arriving  q! C% [' @, a" z% ]! U
    clone 1 load to P_pick(A_induct)" i/ s2 h2 ]0 u/ l3 S/ |' K; u- d/ G
end最大的系
# U& b) B- J$ |+ m$ k+ Y/ l/ P
' d; P, I" b: Y* Fbegin P_pick arriving. s+ c0 Z! }7 d+ O+ {. X
    set A_i to procindex * 10 + 1- P! f# o; m  e+ L& x# x+ M, r
    move into Q_induct(procindex)* B7 N2 N, e4 b+ D
    move into pickaisle.induct(procindex)# o3 Q" W! C( p# c: m1 R  b& }
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ A3 c$ n/ Q& S$ [, k$ Z. o. O  R9 G% d. l  X9 U9 g7 T: l
    while A_i<=30 do begin6 Z; r3 o0 ?: x" D  Y) }5 U
        travel to pickaisle.con(A_i)7 W4 p7 D( X. @9 t1 w/ ]5 c" n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 E& K9 t3 E5 t8 A. i; m3 Z8 p        else wait for 10 sec3 d5 B+ l- A0 ?2 T8 |: Q
        if A_i=A_leave then send to die
/ t9 g& @4 D9 W8 R% V, b! X- M/ w        else inc A_i by 1
9 i! U) D: E, U6 G8 N2 J    end, j/ n7 V1 Y+ N* [* y. x9 N
end4 y3 |0 p: ^. c0 Z7 Z' |, U7 N: ~
  [* U$ C1 _- v
其中的procindex为整形,代表当前process的序号。
6 g8 {% H3 H6 s+ _- U9 Ostation和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-1-13 10:50 , Processed in 0.015540 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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