设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13177|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s4 O' r+ u3 N9 c  }1 F' I! @8 g/ R9 Q+ G: b  w9 W$ i7 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中的数值,不知道会不会有什么不妥。5 B/ P/ R% s' O7 V1 \4 E# x' \

+ r1 t6 O8 f8 Pbegin P_read arriving9 ~* y: e  A: {: Z% t1 Q4 H
    while 1=1 do begin
' {) T% r. c  O        read A_tote from "data.txt" with delimiter "\n". \* L$ D( |( i4 P  K& {) Q$ T
        read A_time from "data.txt" with delimiter "\n"
. @0 j& Z7 ]+ P! m: r! v; {1 I9 @        read A_leave from "data.txt" with delimiter "\n"
, }9 \5 [3 ~5 U9 S: ?        read A_picks from "data.txt" with delimiter "\n"( \( Y8 f+ U  S; }
        set load type to A_tote- i; y8 `  ?# G3 n8 V
        if A_tote="tote 1" then set A_induct to 1
) |9 N( V; f" A! |' R' _6 C        else if A_tote="tote 2" then set A_induct to 2
+ j$ \& J( Y, ?            else set A_induct to 3    7 D/ G! M  Z6 B! {9 J! Q6 B
        set A_i to 07 @7 I9 X2 `# |$ b5 p
        clone 1 load to P_induction  Z# E: K: f5 J. t" w
        wait for A_time sec
9 w0 e* r: N  I# W    end! A2 K+ Y/ n  N; Y9 T$ ^9 r
end
7 `( ~+ K1 U+ Z* n9 M" x; \$ X- i1 o" V" c' P: A( A
begin P_induction arriving
  i: E% A& @/ Z+ r/ D! J    if A_induct=1 then clone 1 load to P_pick13 g: q& l4 h' p, p9 A6 M! M5 l3 K
    else if A_induct=2 then clone 1 load to P_pick2
2 Z- k: [: i* Z5 W9 j7 T        else clone 1 load to P_pick3
+ _& r! g! y9 l+ \2 tend
3 |& g+ ^1 [, [1 f3 Y; y& y2 \9 I: Z. I; S* H3 [
begin P_pick1 arriving$ }/ p0 D3 O# |* E& O+ ~9 b& U
    set A_i to 1
4 d% ?+ u/ G  O    move into Q_induct1
" [3 \6 b$ v% A6 k+ S5 [    move into pickaisle.induct1
2 }, o, w% q3 h+ V9 a    while A_i<=30 do begin( T& Y  u& b+ e# B1 v& ~" s
        travel to pickaisle.con(A_i)
/ j# U% c9 f: X, ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% J( ^, J, i7 t# ]
        else wait for 10 sec
" G9 r! i# z6 O, G3 I        if A_i=A_leave then send to die
4 O8 O: L( F( c1 B% i9 D        else inc A_i by 1) L( B3 \# I5 J* k3 w
    end& {1 |/ g# l: B9 }# C5 r# v
end! z: G/ x/ A' F! x# J9 g0 d0 C

  ^1 N! B- c& y8 h5 v7 n2 Tbegin P_pick2 arriving* H4 [" t3 U& ^' D; O
    set A_i to 11" r1 T/ H  O5 T; p
    move into Q_induct2
3 R+ L; O  N1 N6 d    move into pickaisle.induct27 P6 ^6 L7 I5 e) Q
    while A_i<=30 do begin
/ {. [$ t  {0 _) g- ]1 s        travel to pickaisle.con(A_i)) @$ U7 K% z8 `: ^5 D3 J; D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 `8 }. v* S. F4 c$ w2 K
        else wait for 10 sec; |" l/ I- @. l+ \- {  J9 `8 t
        if A_i=A_leave then send to die
" y, F6 w' N7 b0 m- ~/ C$ l        else inc A_i by 14 E" o, t' Z* l8 f( b! X5 L  L0 [
    end0 e4 u8 e& \& i
end  Q% W: @& a$ f0 |

7 v- X* R* a0 e3 C7 P9 ~" A' |8 Tbegin P_pick3 arriving
" i& m& N' r# J! D+ o" u6 S* Y    set A_i to 21
6 R) @% \9 Y2 G" }, d0 P0 D    move into Q_induct35 U" M/ K8 a3 u. ~7 C1 T* y( y8 e
    move into pickaisle.induct3) f& X# A6 e; g  r6 P3 p
    while A_i<=30 do begin* Y/ E" L3 n8 i  Y+ U; @( R% g1 {- X
        travel to pickaisle.con(A_i)- `! U! A% u- K. L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; s1 T- ?# v) n! Y% {/ I; v# P
        else wait for 10 sec
' _0 `( n2 }& S* |% a        if A_i=A_leave then send to die
; w6 N# W9 w6 H0 ^8 I        else inc A_i by 1
  q( M$ f5 e# t; K! i+ X    end  [6 ?5 z5 E  N2 C) d  Q; x! M, \
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是个什么东东?$ a- N9 m; P2 g! K! \8 H' {9 g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 E; X9 L$ L3 q3 W" j
' y8 o1 i, Q& _, oAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) y7 c9 w7 G" Z: o( @) p2 ^/ L* r* G3 f. M  k; i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% V' W$ I( S. p+ G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ N! G: a2 A- u" k# O# i2 C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 d" ~1 T6 P2 s1 Q1 g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) z4 G0 q2 {% lbegin P_induction arriving0 N7 ?8 B* H; q3 Z) k
    clone 1 load to P_pick(A_induct)$ x$ ^  d5 K1 B2 }. o' s
end最大的系8 P: e) }$ r" |

" v4 F! a/ }: z1 o+ @4 b& L4 {9 Abegin P_pick arriving
9 |1 T- r7 a6 x    set A_i to procindex * 10 + 1' H, I) P9 E$ T; A0 X* Q
    move into Q_induct(procindex)1 V9 k9 p: v3 T0 ~9 x& [
    move into pickaisle.induct(procindex), P8 E+ C  H1 N* M6 f8 @* [8 I' w
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 w8 T3 D- }- [) I  ]5 P
/ V3 f* R+ u+ h$ [0 a    while A_i<=30 do begin
! @; a1 Y# m6 D2 I) k        travel to pickaisle.con(A_i)
$ A' S7 b! Q' z7 W; {+ q3 L# N, ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- x+ f6 r5 i4 a+ p% X3 P4 i$ ?        else wait for 10 sec
  p+ e1 p0 s2 k        if A_i=A_leave then send to die
2 e! q7 ]+ o2 z) f$ B        else inc A_i by 1
7 @* K9 [7 H5 g, I2 W; @4 F+ r    end
1 D* J) p* `; ~& F6 cend/ x+ S, d9 v. f/ X& R

. L& _4 o$ t6 }9 e其中的procindex为整形,代表当前process的序号。" W' Z1 V6 t' F, e  r: M
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-3-24 14:24 , Processed in 0.017858 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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