设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13415|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 X7 H, M! \; J# w% k/ Y8 `8 ^+ j( r7 v* {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' K, p" L) c" x8 C7 j" A7 z$ U; R8 S
3 }7 Q! r. s+ o# M" |
begin P_read arriving6 F5 r$ L6 e5 G1 A- u5 _1 Z  W
    while 1=1 do begin
2 \/ p. o6 Z/ w9 M+ D( r        read A_tote from "data.txt" with delimiter "\n"
! b$ j. z0 P: Q' _        read A_time from "data.txt" with delimiter "\n"/ B# ?! ~* T- w4 a5 }
        read A_leave from "data.txt" with delimiter "\n"
( Q; U. d/ X0 j% o! S        read A_picks from "data.txt" with delimiter "\n"
9 g- u+ ]" G  K  e8 N+ I        set load type to A_tote. B' u" G+ z  x3 t
        if A_tote="tote 1" then set A_induct to 1$ n2 K' F: Q: T% N) W  f0 e9 ]
        else if A_tote="tote 2" then set A_induct to 2
; M9 ]2 E1 N3 m  O: }' V$ B            else set A_induct to 3    # {5 r, J; Y. G# W
        set A_i to 0  K% b& @7 Q; p" @
        clone 1 load to P_induction* B, A6 Q8 p# S7 o, s$ k5 _
        wait for A_time sec
+ K9 ^( C# e5 n4 `    end6 X0 V$ e" W9 x
end
8 R; x0 [& }( F+ P6 p; j4 K; i+ P% U7 ^
begin P_induction arriving- e9 z! z8 s$ \4 i: }1 N7 U
    if A_induct=1 then clone 1 load to P_pick1: @) y& W! H+ G- p& V8 A, h5 {
    else if A_induct=2 then clone 1 load to P_pick2' Y, @6 X7 T4 K( ?2 j
        else clone 1 load to P_pick3
6 D. A9 ]; B2 s6 t! Zend
- }' _6 T+ ~( w) N; q
$ E' [+ m2 x1 O( _$ Gbegin P_pick1 arriving  E* V% v, p$ X- r; }: ?
    set A_i to 10 c' D$ J+ s7 o, Y, {7 ^3 t
    move into Q_induct1
9 y! s( N+ n2 d. {. l% d    move into pickaisle.induct11 G& }! M3 z* P7 n, m, C) P
    while A_i<=30 do begin( a" G8 h! A8 T  k
        travel to pickaisle.con(A_i)
" h( o" O: }1 z; P3 K! I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 A3 h2 ?$ n7 j: G" u6 `
        else wait for 10 sec
0 O6 f& L9 H3 T3 |        if A_i=A_leave then send to die4 s+ H# u  f0 P+ X. C3 c0 O
        else inc A_i by 1
6 ]* B4 \3 [; K4 Q% c9 v+ G    end
) f0 M6 L0 T) y$ m( d. [end
2 W/ x& j4 K7 L7 T) a# v9 ^) L1 e* M3 t) t: d  z4 c! R
begin P_pick2 arriving6 ]. L. T: |" G  U: m- k6 G
    set A_i to 112 C: @+ f: n) x7 o  a% s
    move into Q_induct2+ o; n3 _8 n" X& t% U
    move into pickaisle.induct2. B; l- P" `9 v) [
    while A_i<=30 do begin' g/ ^! z( U' t  N. b
        travel to pickaisle.con(A_i)5 E8 E; N; b% ^  U$ n2 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Z0 N& H9 y, ?6 ?4 X
        else wait for 10 sec
! H( h% u( v% h' ]4 t7 e  h0 z$ [        if A_i=A_leave then send to die& ]  m6 R# F  V4 L
        else inc A_i by 1+ h" S$ ^* T+ _
    end: Q: |& B4 |3 B  H& z/ ?, I2 F1 p
end
! H0 \  Y) V- j  z0 i* H% F+ ~# Q
( M4 p# B; d. Q( M' b# A+ Wbegin P_pick3 arriving
& ]9 e* s5 p" d% Y    set A_i to 21; U- p8 G# Z+ {5 O* y  d4 N
    move into Q_induct3# t; p' G8 U$ v  Y4 S- R
    move into pickaisle.induct35 ~* n0 g( E- G6 ^5 x
    while A_i<=30 do begin
1 M/ m% }+ l9 |        travel to pickaisle.con(A_i)
8 I0 f5 t% K3 G3 F5 }9 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' v0 p& @4 b" Z: P7 ~        else wait for 10 sec
( ?3 c: o- O, ]9 [4 Z$ T) L" S/ f        if A_i=A_leave then send to die$ _2 e: ^+ y2 K1 j: y5 p
        else inc A_i by 1+ `0 u0 k# N& X/ b1 Y9 c
    end
  i$ `. G' y" 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是个什么东东?+ {+ ]( Z% Z4 Q; s: ^
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" Z, \5 g3 L& `- `0 S5 @% p9 x" ]* B; H1 m( i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! m& }6 ]" [9 P, |
% E* N5 q# o0 o# x- t
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 n7 Q3 t  v' t
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& P4 S. s# \" E0 U- S5 q; ^. v1 K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 Y2 M2 u7 V& x# }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 Y+ _) ^& d" K; p1 D/ N  [1 e+ {
begin P_induction arriving- h: D4 ~" m+ l' `6 f9 ?! j
    clone 1 load to P_pick(A_induct)
1 o0 f, h. D' z% c* x2 zend最大的系5 }7 u7 C  m4 ?# T9 a

) L% f# \. F5 ]5 T$ Abegin P_pick arriving! C/ w. I% [( x  w
    set A_i to procindex * 10 + 1: ]2 ~( o) n5 i! |7 p
    move into Q_induct(procindex)9 V0 L# i% I& a. F/ }( L
    move into pickaisle.induct(procindex)
0 E3 t6 Y; U" P, k: P3 q( F* \    /*check the type of pickaisle.induct(i), for your last problem.*// m) @1 V% Z$ w  k

/ g* z# X. i, h9 ~0 S, J    while A_i<=30 do begin' U; k, h7 h( H1 s
        travel to pickaisle.con(A_i)! d7 [# ~  Y5 f. V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& R2 U9 O- o- w- x8 r: R        else wait for 10 sec
& h% f; H; `) K5 G3 x5 N) b        if A_i=A_leave then send to die7 h0 g8 {7 Q. k5 R  t1 {9 Y
        else inc A_i by 16 a/ G7 S: U2 `
    end7 s1 m. s! Z1 ^* k
end
. L) ?+ @& n9 W! B) b1 _  j. z7 i" p8 L' w2 J
其中的procindex为整形,代表当前process的序号。" j7 a# u4 h0 ]& d3 |' l$ D1 d
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-4-11 18:56 , Processed in 0.015176 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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