设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13352|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. ^0 i$ H" e* w3 \( m' A2 q0 `* A4 o8 X/ R  `, i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 i: R, a7 A& _: M6 b1 r4 h
0 h# M2 j7 O. w; T1 Abegin P_read arriving
/ _/ b' b, _6 Y0 M    while 1=1 do begin' K9 L$ z' |0 X+ z; G/ y
        read A_tote from "data.txt" with delimiter "\n"! x- D; h0 x( x
        read A_time from "data.txt" with delimiter "\n"! b" x; p. x) O$ K; O* y, J  B
        read A_leave from "data.txt" with delimiter "\n"
9 o4 e- Z# D: F) T        read A_picks from "data.txt" with delimiter "\n"
. e( C. _9 r: K* p$ B        set load type to A_tote
+ M0 W% N. A( ~  w5 L        if A_tote="tote 1" then set A_induct to 1
' M3 a, |" H$ w; F3 F" O! t/ J+ Q        else if A_tote="tote 2" then set A_induct to 2
  m- _  U, m# C4 G! l2 z0 k            else set A_induct to 3    ' g& ]: x0 I1 W4 U. V* e+ J
        set A_i to 05 \' ^, d) h4 P6 L: e
        clone 1 load to P_induction
$ c+ u/ }/ I5 V: k- g% D( `        wait for A_time sec- K# u" q  P) @' b; c
    end
9 `! t9 B# C' s) p: o( ?end
$ N9 S) l3 C8 t3 S3 P* e' d; m# o) H  ?
begin P_induction arriving
9 l) m! d, g; d$ a# U    if A_induct=1 then clone 1 load to P_pick1
4 [' n$ u+ w  M$ g# W* Y, I$ ]0 ^    else if A_induct=2 then clone 1 load to P_pick2, F! c+ t: ?+ _' t2 f) K0 `
        else clone 1 load to P_pick3. G5 v1 T% s: b/ p: t
end
- H  y; i: r6 V/ |; U* b: B2 ~: \3 z, T
begin P_pick1 arriving
( n1 e! P) V( H! R    set A_i to 18 C7 R7 h0 V8 e+ n$ b
    move into Q_induct1
2 i* y8 e) a& l  B. s# P- c1 y    move into pickaisle.induct14 f$ b# V! J' N* P$ b3 _- @. B' {
    while A_i<=30 do begin
  \  {  d. W; @) w7 v1 c5 t        travel to pickaisle.con(A_i)$ n$ s7 P4 l4 j, `4 @4 c7 \0 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, F" c/ t8 p  U/ F' l        else wait for 10 sec
! O: z2 F0 f* t/ o        if A_i=A_leave then send to die
& J) B$ _% Y& J# u        else inc A_i by 1
4 Q- R3 Q3 E% j. A/ }    end
! n& f( k0 ?* Vend& d) ^4 o" b- E
" U. P' x$ @7 c1 s# u8 ?' A
begin P_pick2 arriving5 R% X- A9 X0 d6 V+ ^( W
    set A_i to 11
/ ^( {3 f  l2 s" U    move into Q_induct2
& Y( Y. ?- ^7 q% o) Y# b    move into pickaisle.induct2
, n; p6 Y7 t+ H. D0 P- d    while A_i<=30 do begin3 f0 f! N3 G% s; Z
        travel to pickaisle.con(A_i)
5 `9 ?5 W- J. c& }$ s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, d* T. b) a  G# ]& v9 i" q: t
        else wait for 10 sec4 D# O$ j: S# j3 L4 ?+ k. D, m
        if A_i=A_leave then send to die' k/ s8 t0 y0 A$ m& H  {' o) M
        else inc A_i by 1
9 h$ l7 r3 H. J' q2 Q/ ]5 b% d    end
+ G0 [9 Z) k0 O( }$ ~( Wend# r5 O; H7 v, D( v* n# M
0 E9 K% Q; M8 i6 I$ l' m; N, A
begin P_pick3 arriving/ T' Y& ^7 o: N1 e# |7 G
    set A_i to 21
6 r: S+ A) A& z; S" a! Q    move into Q_induct3
/ v- t% I, J: z- |* d  k9 L: k    move into pickaisle.induct3. K4 H& y2 j& B, c' j
    while A_i<=30 do begin
( `1 D/ [2 \) O! r        travel to pickaisle.con(A_i)
1 I0 T4 B: k) T9 O5 [0 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ @$ D- {# C+ J, O        else wait for 10 sec: s! J0 C$ U1 I" N  R- U
        if A_i=A_leave then send to die3 B- q! A* G9 p& J$ P% w: |, O
        else inc A_i by 1
/ d2 n9 q1 G+ [    end
, j: a6 T3 u% Y) _( Z1 s% F7 J4 Y9 {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是个什么东东?
0 m! m, j. t  k4 J" i6 l7 ^* D& `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* s4 P4 n3 t3 [  O2 o3 b2 V
- A$ t  |+ w$ ^" @7 M1 _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ X$ [/ k9 c3 h/ e+ p4 q0 I5 U% o
9 _9 X( Q# ]8 {; \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 T5 O8 |4 [- v3 N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 z1 K$ ^8 z" i, s  y  G( L: u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ r, V9 w' s; f9 s# Y# }9 ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* W) Z9 Q3 {, {+ l; ]$ V: d4 _
begin P_induction arriving
, c3 Q& t. T4 E    clone 1 load to P_pick(A_induct)  e, y4 I) m: {/ ^/ |) ~
end最大的系3 B1 {" \# A1 m& s2 @
. q! h: M: D9 j
begin P_pick arriving
; h. a3 `1 R0 g& U2 q) I) H0 U    set A_i to procindex * 10 + 1
- r4 X) S# r( x/ U- M/ h' C9 H    move into Q_induct(procindex)
! O' r, d  {8 [- L    move into pickaisle.induct(procindex)
3 @: u, c4 S0 y* |9 Z3 P  z( E    /*check the type of pickaisle.induct(i), for your last problem.*/
8 ~1 E6 e) V1 v7 @% [# [; S% g8 v* U* R% P8 a& d
    while A_i<=30 do begin
/ {) U* @( J& N+ c  S' E9 W        travel to pickaisle.con(A_i)- x) r$ R- P* _. G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; _, L! X4 t5 |: C/ P1 P
        else wait for 10 sec4 \( f/ t. H7 g  k6 e8 [$ E3 h( `; p
        if A_i=A_leave then send to die
1 c7 j' p0 C( T6 e3 ^- Q* a        else inc A_i by 1  X" ~# M) v. x7 e2 r
    end8 O) K" Y: h- s1 ^
end
1 Z* K  [0 ^& B; S" T, o. J) ^, g' h+ z: X
其中的procindex为整形,代表当前process的序号。2 J2 V* V& B; u( Q1 S' q0 A
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-6 13:42 , Processed in 0.019739 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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