设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13575|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& l2 H" c" A# [3 E/ s# y" n7 w' y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ]3 a( X5 V. b* Q! t! f: P# Z
. w1 u2 |$ F! Q4 h3 W: |3 zbegin P_read arriving
" }2 n4 x5 j- x  E# t6 S. `    while 1=1 do begin$ z% u7 _( k; _- K( c- v. y0 c
        read A_tote from "data.txt" with delimiter "\n"
( |- i4 c$ m* U" s2 c! V        read A_time from "data.txt" with delimiter "\n"# Y" \* \4 S$ F
        read A_leave from "data.txt" with delimiter "\n"
, ^: k' C2 ^; P# x2 ~$ c        read A_picks from "data.txt" with delimiter "\n"( ^- g( L! K# n! ~  `
        set load type to A_tote
2 C5 _8 a4 H4 t        if A_tote="tote 1" then set A_induct to 1
% i( e' {7 k' B9 e; ?0 }        else if A_tote="tote 2" then set A_induct to 2+ r( w% {4 U/ q- H5 n6 p& c
            else set A_induct to 3    ! c) H1 G# B, d9 `: s
        set A_i to 05 V& g" l7 O/ o* P
        clone 1 load to P_induction
/ _% s8 n0 N, ^; K/ D  \        wait for A_time sec' c, b! A* V% g( X' `, r9 ]$ Z& E
    end
4 C3 m/ N, d& }6 |0 }/ c: uend3 h1 j5 `- _( n2 h3 T5 P# @# _
" ^, D( `1 t2 A! I! j: J
begin P_induction arriving- B$ H, [( t* ~  Z
    if A_induct=1 then clone 1 load to P_pick1
, w, D9 z- E9 H. V5 G7 M. m$ o    else if A_induct=2 then clone 1 load to P_pick2" ~  n+ y4 ?- H( B
        else clone 1 load to P_pick3( s2 l0 {: p; m1 f
end
) |+ f. W" c( q/ N; f2 _1 R; q! a/ D. F/ i' R0 v; X8 B
begin P_pick1 arriving% C! e6 \# x1 e) n3 k8 D& |
    set A_i to 1
4 X+ a  a) ?0 X6 A1 k! {6 ~    move into Q_induct1
6 z1 M9 l: ]% K  V    move into pickaisle.induct1& A: n/ X; n9 m5 R
    while A_i<=30 do begin* t1 X; _. Z7 }$ t9 w+ s
        travel to pickaisle.con(A_i)
' C6 q" C' f( p1 }6 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ v1 `& s6 R( ?) i& g        else wait for 10 sec
9 y) K. l$ C! W        if A_i=A_leave then send to die0 p1 S9 G7 E4 @9 o
        else inc A_i by 1# R6 O- [; f* e- N+ {
    end
$ |( ], q4 L! p, K$ H! g* D: Fend
; k/ J' a- Z5 y4 I  @$ x: K, i& U0 C4 r, G2 \; d
begin P_pick2 arriving* f& H" b7 I9 ^7 _1 A4 _
    set A_i to 11
+ X: ^2 X5 m' i2 ]2 n0 H6 d    move into Q_induct2
0 M! u# g- k1 W    move into pickaisle.induct2
; i1 r' b' U# N* r9 x  j: o    while A_i<=30 do begin' ^% O. L/ q2 f, v& ^, R- r
        travel to pickaisle.con(A_i)4 |* X5 c" C" E/ M  \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& j1 R# K% ]. Y        else wait for 10 sec0 B* C4 ^% Z  n. ^; ^- C
        if A_i=A_leave then send to die
; R' b4 u# t* P9 {        else inc A_i by 1/ |1 A# P9 Q. y6 q0 F7 }8 d; W% t4 }
    end0 R3 H9 i* U5 g
end
. \1 A% n6 v+ U$ M1 c" s5 s/ Q% g* E1 O2 M; G
begin P_pick3 arriving
+ _% r5 y, d( n$ @    set A_i to 21
% s. `1 @9 E/ p. r% ]1 o3 e2 W5 q    move into Q_induct3
6 \( T' ?" V2 F  P4 [    move into pickaisle.induct3& I$ s0 X* e! ^# z. N
    while A_i<=30 do begin
, _" _/ a4 A* K        travel to pickaisle.con(A_i)8 r/ U. j7 h: e( ^2 t2 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ t; E6 a2 J" A, `( ]0 j, R8 m# O* P
        else wait for 10 sec
* Y* a) g1 m1 B; x# d        if A_i=A_leave then send to die
" ], `; W4 j2 }7 `4 \5 ]/ d6 l        else inc A_i by 1! M" G$ q/ ^# w1 M& j
    end8 E" z+ I7 F; Z6 I
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是个什么东东?; F, v, t) B. y3 a: K' ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* E3 I4 d6 Q7 h7 n

* p  y1 I) f& B! M4 rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 j: u% P) R! ]0 G9 \, |; \9 q6 S
5 H1 A; q/ T) d7 m' }5 ~) `8 T) m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! v0 W4 c  \5 H0 R
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 V/ Z+ O5 N& o' [. V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. H3 L+ W/ R  q4 O2 P& e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 {5 ?1 _. d7 D# Y) _1 xbegin P_induction arriving
7 b! ^0 S, w* e( P! G; i% T    clone 1 load to P_pick(A_induct)5 A: e" Z+ o" J, c+ d
end最大的系
2 h5 b1 x- W# c! c5 w5 O8 s% `. f. `6 b0 K* G: o
begin P_pick arriving/ Q+ I6 z, o6 Z+ Y3 A+ V
    set A_i to procindex * 10 + 1) {, L$ B7 }8 @% {. X  T; F; Q
    move into Q_induct(procindex)
! X2 x8 o* U( l    move into pickaisle.induct(procindex)6 [4 H* w1 K/ p$ P2 t6 U  j! h, l
    /*check the type of pickaisle.induct(i), for your last problem.*/1 b$ a& S. U% ^" p  d+ a

& E6 L8 M3 M' m' z9 H* E    while A_i<=30 do begin
  U+ y! t* c6 O8 d" L        travel to pickaisle.con(A_i)$ @; Z- @% \& {9 \3 A6 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- f# t) C6 E; H. }        else wait for 10 sec
  H1 A( F, q9 ]# X5 n1 T) V        if A_i=A_leave then send to die
, m. |  U0 b; I5 n/ d+ o! |3 H& u        else inc A_i by 1
* m- j1 O9 W' e+ Z5 s    end
; s  C; c1 c# p% |end* E7 c4 I6 Y* ]3 [

: W  b/ Q$ F+ D其中的procindex为整形,代表当前process的序号。
! M- U2 F- R3 C9 m5 L! T/ T: ?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-22 05:49 , Processed in 0.016638 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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