设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13758|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) l. E  V! D, \' s0 \( W
/ z& }  V$ F( T5 u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 a# [; Q8 p& e; o# V% Y& D& m, S" S$ ?  o' k/ R$ a
begin P_read arriving
. e' Y" Q/ Z6 _6 V# I0 s4 f3 P# x    while 1=1 do begin. h6 L5 S7 O% `% n- K
        read A_tote from "data.txt" with delimiter "\n"# g% X1 V! r8 g+ v1 Z+ d" Q6 h) \
        read A_time from "data.txt" with delimiter "\n"
+ ~, j: q* i2 C7 g* @: V8 r        read A_leave from "data.txt" with delimiter "\n"
% H- T8 }. g  t- r& ^        read A_picks from "data.txt" with delimiter "\n"
; G( }8 d+ ?& B        set load type to A_tote8 X8 m: K# z2 G; k  D" E
        if A_tote="tote 1" then set A_induct to 1
, M& p- t* R9 I7 Y# _3 y& Q% c        else if A_tote="tote 2" then set A_induct to 2
6 K: ~5 [3 p  l, F3 q9 a            else set A_induct to 3    $ o  t- q7 e; }( {, H
        set A_i to 06 p9 O: F5 g2 l0 a& f0 d
        clone 1 load to P_induction3 v  X3 d0 B7 _( ]
        wait for A_time sec( V4 h/ @& s8 U5 ?3 a
    end
6 R% z- P: g0 v. X* [, ~end
7 p( q5 `( s6 n+ d( C: q$ K, a1 |4 y- S2 t1 x+ d; {# x0 {
begin P_induction arriving4 H! _$ N) B* x, [6 l
    if A_induct=1 then clone 1 load to P_pick1. i( z) g* z# u! G8 v; B* i" w
    else if A_induct=2 then clone 1 load to P_pick2
) C6 N' N6 `' @) k% X3 \+ E( O8 i        else clone 1 load to P_pick3( {! o0 Q5 |: [' ?6 Z
end* A& ?% P( r! E5 W, n4 c

. |3 j& L8 p; gbegin P_pick1 arriving
$ e, n& N9 M2 _' E    set A_i to 1
! V. g+ h  W3 b* i& Z$ t    move into Q_induct1
- S, k5 `0 W0 r  I( g+ I- }    move into pickaisle.induct1
" [0 x( U7 B5 w. Z! ~6 |    while A_i<=30 do begin0 x; ]% t5 ]* b8 W0 U- X/ t1 \
        travel to pickaisle.con(A_i)! p; b" I2 K1 m, s5 Z: s: W+ R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }$ p% X! `: Z0 n# a
        else wait for 10 sec
6 ?* f* u1 p3 P: s5 l" K        if A_i=A_leave then send to die
7 I, j* k) y% W/ f        else inc A_i by 1# t7 C, \  E; P( a% E
    end
, p9 ?4 x: ~7 N+ [1 _end
, u! W+ |  o2 i# M% L' r5 G" A3 J) \; q( ~: E
begin P_pick2 arriving
$ R! i5 S0 {6 ^; U0 R/ i8 D' q    set A_i to 11
$ }% l+ k5 a( y$ C8 c    move into Q_induct2
# l  X0 G! o8 k# K; T    move into pickaisle.induct2$ G' L' |* n7 |. _
    while A_i<=30 do begin- l2 f5 _: H+ c! O# M5 v/ E
        travel to pickaisle.con(A_i)
8 B6 c+ I& \, f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 g! _, x5 x" i" X        else wait for 10 sec# S4 F+ x' ~9 }  T% i4 L
        if A_i=A_leave then send to die
; Y6 {8 I9 n5 }/ N, g        else inc A_i by 1
/ ~* ?6 h6 v0 A5 p3 ~' E* n    end
1 M% m  i# c& f) rend+ E) @: F' q( @2 u1 X9 p

8 A) r8 A3 w  G0 T5 i9 kbegin P_pick3 arriving9 j/ n, S0 i) e6 @; F! A
    set A_i to 21
0 G% h5 J. x8 \    move into Q_induct3
& q* K8 A* W& S& O; \) D    move into pickaisle.induct36 e$ D: o: F0 v
    while A_i<=30 do begin, I6 t  E; }2 o+ p' v4 U
        travel to pickaisle.con(A_i)
- I- j; M; _" z% }3 U. w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) C8 Z% Y  _1 u5 L( P2 I$ k; ^/ a        else wait for 10 sec
. N' m& W2 O2 U% R: T- ^        if A_i=A_leave then send to die- Q5 `8 t, P/ u2 j; Z6 I0 b2 W
        else inc A_i by 1' S* m' U1 s6 k
    end+ U6 c. C/ w  A  `* @
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是个什么东东?
" N" {9 i7 O# q+ wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" ~7 g/ D  ^+ ^" b. |

1 T6 D) E* k" YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. t0 O6 [8 {) I4 E/ }7 P9 j
7 ?6 J& N) W3 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& _3 H; @$ g, ^4 @9 @) g- _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: i( L: e$ k" e' G$ P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 f/ }( y& \  A, I5 I$ [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( \; E) \; ?9 M; ?5 e' G: U
begin P_induction arriving$ |, Y# Q( A. e: Q; N& n2 G+ ~
    clone 1 load to P_pick(A_induct)
4 l1 D9 q$ X& @( \# qend最大的系
1 q. {# O' N( H) w. ^8 P- Z$ I
begin P_pick arriving/ p0 f, X& l. c8 m( N+ k0 ]; o/ q: T" ^
    set A_i to procindex * 10 + 1
6 b% \. B* p- Y" K* r; Z    move into Q_induct(procindex)
" h* A! Y4 L1 ?" {    move into pickaisle.induct(procindex)
5 @  B( K# T* D( u    /*check the type of pickaisle.induct(i), for your last problem.*/- o$ `  t: |/ y! G: C$ f

3 l, L- h7 b+ w; X    while A_i<=30 do begin" f6 U. r+ Y# S! I  A  Z0 \$ ]; q
        travel to pickaisle.con(A_i)
8 d0 `, K0 r8 o1 Y4 x3 M7 k2 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, y9 M& ~2 }: [1 U
        else wait for 10 sec
  \& x' W3 O3 }9 C9 v+ j( S        if A_i=A_leave then send to die& ^+ U& j$ t2 k  @7 b# G5 B  v
        else inc A_i by 1
. \) Q+ R% N. m    end
! f; J( ~2 ~* j: m; z- x# L: Xend
; I- |9 M3 @( f5 m& u' S* [; D+ ], w' M7 N, G) K" k
其中的procindex为整形,代表当前process的序号。
; p% T; B$ i9 u' s: W! Ustation和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-5-3 08:03 , Processed in 0.015400 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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