设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12697|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 l/ N8 G5 W9 r7 f+ P1 f5 o1 i/ g+ a' B6 a/ |/ y& u& O1 X* |$ E8 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, Y$ j7 N. _# z9 z6 A1 T' p
6 x8 I9 E* ~5 c" Ibegin P_read arriving4 H* x% q1 N. s& M1 w
    while 1=1 do begin
# y) f/ J+ O# P, W+ l        read A_tote from "data.txt" with delimiter "\n"! k8 h. t4 A. F6 |" G8 Z
        read A_time from "data.txt" with delimiter "\n"
4 f- X) F3 Q" }& n3 m        read A_leave from "data.txt" with delimiter "\n"
! M& x. _3 P0 Q! M        read A_picks from "data.txt" with delimiter "\n"
+ ^& U! t. m( z" }" z: Y2 Q$ N6 n        set load type to A_tote  T. R+ F1 x" s
        if A_tote="tote 1" then set A_induct to 1
; F( o" H) \6 n* r/ o8 P        else if A_tote="tote 2" then set A_induct to 2& U3 c- |. h8 }2 ^
            else set A_induct to 3   
1 z$ c" V( Q4 ]        set A_i to 0
4 T& @8 A; `/ ~2 W( d- U' X8 [- K        clone 1 load to P_induction
( l/ M( [3 M$ V        wait for A_time sec
0 F8 \6 r6 D6 x) E. ~    end
; t0 v! j2 p5 p! Z3 W- aend
  w# N) w' v' h, e  H, A. X% y' v% n  `7 @& H! C. P
begin P_induction arriving5 k) k# X2 q$ z( v
    if A_induct=1 then clone 1 load to P_pick1
& o/ g5 I4 ?0 j* s6 u  q3 d    else if A_induct=2 then clone 1 load to P_pick2+ X9 O% c) b1 R! c3 X
        else clone 1 load to P_pick3
9 q" {, l' O7 C5 aend
: T2 X  A! }, R0 D3 h- L' w3 F# E! f& b
begin P_pick1 arriving7 F# G* E' _* K( Z
    set A_i to 1! s  A6 l" G" l/ G
    move into Q_induct1
& F( w/ K: I7 q/ G    move into pickaisle.induct17 Q0 B! A: e2 Z5 o
    while A_i<=30 do begin
  z; U% X" I, g% [        travel to pickaisle.con(A_i)2 T% L( v1 P7 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: m: `6 g2 o' _/ c7 t# H8 }8 d        else wait for 10 sec% N2 v" v7 T$ |: h
        if A_i=A_leave then send to die0 b! Z- I! C) B% M+ `2 k
        else inc A_i by 1
2 R: E  C$ B; }* m3 M0 F    end5 P) F9 Z" r8 F
end
9 W9 s6 v5 U  X* p# W9 X2 [% \  D3 L
begin P_pick2 arriving6 H9 q: h4 p, t
    set A_i to 11
: k0 s5 b6 Q5 |) T( g. t3 l    move into Q_induct2
3 R: E- i( R& j: u& J    move into pickaisle.induct25 E, G. r% S2 b& H6 t  {& D  [! Q$ @
    while A_i<=30 do begin1 R8 C- q' P8 _* p. ^/ A2 y2 R
        travel to pickaisle.con(A_i)
% u/ k, `  N" A. X$ U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# W5 f" y( |8 R0 Y        else wait for 10 sec( u" g" v# N7 w$ |; E1 Q: R. q( I
        if A_i=A_leave then send to die
' K/ O9 T8 N% i( \        else inc A_i by 1. ^. q. |7 f- Q( B) \7 S4 W9 j
    end
5 a* Y6 {$ L/ n6 l) z7 Xend
8 O  {0 q, O$ {' ?, ~+ e1 S: A( ~+ n5 Q; ?/ C' F% L" e. _
begin P_pick3 arriving
5 f  s* r. v8 K2 {    set A_i to 21
7 s5 o$ K4 f$ |! N; m" R4 [    move into Q_induct38 N$ g9 I& k5 f5 m
    move into pickaisle.induct3
0 M! P" i' ?* d3 O' v9 ^    while A_i<=30 do begin
+ N  b' |0 n2 j( ~4 b% W2 x        travel to pickaisle.con(A_i)
' ~; G* {( J: K( `! t& z" E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 o' ?7 H3 j8 }( n3 s+ n        else wait for 10 sec. ^% P" g) Z* W  }3 C
        if A_i=A_leave then send to die* j% t* D( y6 _: Y2 I
        else inc A_i by 1, A7 @# f& @8 _0 N( i
    end3 p9 A2 [; n2 c8 ~
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是个什么东东?  g# E5 P9 N: \6 c; m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& W0 ~; V2 W6 {; q7 i* `
! [' W- }  J4 N
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ ~" F# I* H; n/ ]  g( C
# M1 j8 |/ U, ?6 z& C5 f
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 }3 c( K; B% X" y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, }. e# q; H' S0 l4 t9 f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% r1 G* {2 S# ^7 d+ E) N0 g9 y$ g- @4 ^
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 w9 J8 L# o5 abegin P_induction arriving
" d) C2 t" a/ k0 \: c3 r' r0 g4 Z, f5 ?    clone 1 load to P_pick(A_induct)
1 L1 {. I/ O6 ^' N2 gend最大的系& A7 b. c5 W. D$ u8 K

' A  Y/ f' U$ E2 ^5 }begin P_pick arriving2 e" h" E- Z  [8 [' ~* u. Z3 p& G5 j
    set A_i to procindex * 10 + 1+ e! H" A3 P4 r
    move into Q_induct(procindex)- Z) B: v' @" f0 D
    move into pickaisle.induct(procindex)' ]3 N' ?! ^8 Z1 P& B! P
    /*check the type of pickaisle.induct(i), for your last problem.*/7 g7 M$ L) M" M) x* a) @
+ o" R0 e" h# y, v" ^2 x
    while A_i<=30 do begin0 w4 t$ I5 u# w3 |& H
        travel to pickaisle.con(A_i)
# p; J$ o9 l" E4 [# n6 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' a: i) f. ]7 G; N& }) N3 A+ g        else wait for 10 sec- u; ]( {2 b0 j/ x6 ]
        if A_i=A_leave then send to die
# C2 E1 z7 P* X, f: m! y: D        else inc A_i by 19 @5 e0 u% n1 O4 b; h, F% L
    end
" j) Z) J6 D' t0 Pend
) p; x8 H% Z! S, a& `% P7 G4 P0 `/ l3 [; t, k0 }  z! [! G
其中的procindex为整形,代表当前process的序号。' w# }. k  I: X) I$ |, p3 K4 _
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-2-11 19:39 , Processed in 0.020654 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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