设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14804|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. j. D$ D8 f2 O) D, z) T* f9 Y* J, |7 w- F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) C8 _$ B7 p/ r2 ^. _, j+ y* j
1 T# J: I4 ?$ e, B$ E4 ~
begin P_read arriving' q" H  f/ H& G# \
    while 1=1 do begin. S3 P4 n2 s2 E- L1 M1 R
        read A_tote from "data.txt" with delimiter "\n"
# E7 S# M% d* j# ]3 u        read A_time from "data.txt" with delimiter "\n"
3 z# r0 Z6 |1 r3 T6 `2 U        read A_leave from "data.txt" with delimiter "\n"4 x& |' V  G! h+ y1 L4 Z" ^! h
        read A_picks from "data.txt" with delimiter "\n"
; [$ M/ s7 a$ [  X  v# q/ S# J        set load type to A_tote
8 o. j7 u' H) b% x        if A_tote="tote 1" then set A_induct to 1
2 I$ @4 K9 l& P. M7 o+ P- i        else if A_tote="tote 2" then set A_induct to 2
0 o- T+ m& Q6 L& n0 J            else set A_induct to 3    7 J! A  N2 y4 O2 A) f) C
        set A_i to 0
8 z+ ^' l% Q) b/ W& Q- t( ~$ O        clone 1 load to P_induction% W! a3 F# ?. c- \1 k  b( |/ [
        wait for A_time sec
& |" f4 b, D% G+ V    end6 W8 [. ~/ U8 V  U% ?7 D
end! r5 _- L! U; c1 h, a
; l6 j( \; |5 b- W3 r. z( v
begin P_induction arriving
3 g2 u0 c9 D$ d' i; N  Q# G# v: c    if A_induct=1 then clone 1 load to P_pick10 o# o" ~+ g  e3 _1 |- }% h, _
    else if A_induct=2 then clone 1 load to P_pick2
4 K4 @8 D: r5 Y8 N" V/ l        else clone 1 load to P_pick3# n2 r# E% i& `
end% ^0 T0 @) c. h) h+ p3 m4 o

/ ^7 I  y0 ]) lbegin P_pick1 arriving0 v7 y  y4 _" l0 Q5 J& a  ?( r$ e" v
    set A_i to 1
' p1 q" u; v2 O    move into Q_induct1
2 X1 v! k/ T0 K+ C3 p    move into pickaisle.induct1
+ A- a0 d7 m" t    while A_i<=30 do begin
0 `+ ^. ?. ^& H6 V        travel to pickaisle.con(A_i)  x1 c& l8 f3 G8 j: ?. }3 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ C8 A& K/ g" D( J* C
        else wait for 10 sec8 t" |% y/ {4 m0 c0 Y( o/ H
        if A_i=A_leave then send to die
/ v2 w2 ^3 w! D' J) g+ `0 f/ {3 {9 c% w        else inc A_i by 1
( o2 H2 e4 V8 b8 Q+ [8 H9 N6 `    end
5 [6 W4 ^; m' u% T. ^2 x; Z4 J5 Pend
$ [5 l$ ~% O6 s% m
# Z8 n4 L& R9 ~: O% m& y; c# Bbegin P_pick2 arriving
. n5 _9 X( b" U+ R    set A_i to 115 m# v% ?6 ~$ x
    move into Q_induct2( ^7 j1 j* F. E7 g  N
    move into pickaisle.induct2
" T( V8 x; B2 M3 m/ D/ u    while A_i<=30 do begin; r! N6 E4 `9 J4 f; }7 J  e! Y9 L7 a
        travel to pickaisle.con(A_i)
$ P' C; O" c: z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 X: h# m- ^: ^* ^% [0 L
        else wait for 10 sec
3 \# h& [+ }8 b: L& x6 r        if A_i=A_leave then send to die
5 a% ~( e" F' u! T! ]9 X/ k5 `1 }& A        else inc A_i by 16 {* w8 W% e0 ?7 N" i. |; C
    end
9 G1 E6 `; P0 i; Zend
$ E% D( g8 o1 ?' e2 ?! g1 f5 \9 u0 |2 B; W- ?, e2 r, ?$ E
begin P_pick3 arriving8 I& W* Q7 v' J. N1 u# |5 J
    set A_i to 213 s! C; e8 n# p' G) C" m
    move into Q_induct3
2 ^& s. ?* I- g& C, _/ Z( j( Z, m    move into pickaisle.induct3
# z; `8 s! ]0 x' h3 M    while A_i<=30 do begin
! r: U( S' P0 \1 e$ P        travel to pickaisle.con(A_i)
9 i9 a6 L+ N0 p, H" `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; l0 j; [# A: P" i( @6 b5 Z, m, I
        else wait for 10 sec5 f+ D$ u2 o( r& F& a8 I
        if A_i=A_leave then send to die; t# e) i% o- Y& C7 n2 E
        else inc A_i by 1
/ ~( I- t  O1 D+ Q. j    end
( F5 Y; ?% m9 l" Qend

最佳答案

查看完整内容

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是个什么东东?
/ I3 |% e3 H5 m. }# ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 U1 s6 A* O9 O: G4 }" Q6 X) y1 |) }' B
' J% c4 l; Y' J& vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* A/ ^* U) A; W2 g# i( t' k9 O3 X0 @+ L7 j" M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! I# t# ^* x2 {$ p: O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ l! J8 O2 N$ v$ w- z4 d$ j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( a8 _; {% a; `6 ?# m, s( E; e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 O$ W/ C: E" g1 C* bbegin P_induction arriving
! P) J" c. U! q3 B! k  F    clone 1 load to P_pick(A_induct)' f. T7 q: v+ F+ b) y: J. E3 B9 C
end最大的系
9 B" n; Q/ }5 F; Z5 \
# H+ `$ p: F7 a  \$ ~9 i7 b9 Hbegin P_pick arriving
4 O: H8 \2 ?% `    set A_i to procindex * 10 + 18 y& @. q. E  c3 V& V) C
    move into Q_induct(procindex)4 r. n$ C2 H: u, |+ V& w7 ?: U' s8 f
    move into pickaisle.induct(procindex)
- g- o7 Z" y* ~- p& L7 c- J( G    /*check the type of pickaisle.induct(i), for your last problem.*/' U1 p* s* l  ~( \
& n; \5 c+ h. Q- {: y
    while A_i<=30 do begin
& S+ n3 ?3 w6 \  Q- q( ^: M! _# G& q6 J        travel to pickaisle.con(A_i)7 [7 j+ w. o! n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ Y% \" a" Q4 z6 @        else wait for 10 sec- j- o0 X# C7 H+ t/ c! a
        if A_i=A_leave then send to die
0 k- J! z& @# G        else inc A_i by 13 P' R) g- y& S' `3 i% ~% b
    end7 y) O+ D* E" K' Y) S  T
end+ O, h& S8 ]4 V: r" p/ E1 K7 J5 q/ N
* ?' W2 [9 O4 y, W9 {. K3 M4 w2 p9 G
其中的procindex为整形,代表当前process的序号。7 t% c, N* o3 b& P
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-7-27 07:03 , Processed in 0.016193 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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