设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13930|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 ?& ~$ H: @- d) B% w6 Y8 e. z% @! l- N
我的问题是,在每个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 a0 d4 G0 W  Q+ k+ N* h/ [6 s  t* P7 k' X
begin P_read arriving
& K: @  C, z/ e% L- h, U1 }5 C    while 1=1 do begin' _: A# Z0 w5 j; Z
        read A_tote from "data.txt" with delimiter "\n"- E( c9 d; [! @9 a4 l* n
        read A_time from "data.txt" with delimiter "\n"* `% u- a3 T8 u- r# w
        read A_leave from "data.txt" with delimiter "\n"
: V( T. w+ N/ M: r0 C, L- [        read A_picks from "data.txt" with delimiter "\n"7 {/ N& c1 B9 m6 F) o, L* d
        set load type to A_tote/ S/ `& F2 d5 c9 p2 \! y  _  J6 Y
        if A_tote="tote 1" then set A_induct to 1
5 f$ K" p6 k% D8 i3 z; K: Q        else if A_tote="tote 2" then set A_induct to 2( e" ~* ^6 C. F- c) v( Q
            else set A_induct to 3   
9 p# N2 c+ K# i: }3 z' Z* H        set A_i to 0. w+ J% ]0 Y: j- S( |0 @: i1 {
        clone 1 load to P_induction4 }+ ~. E# [" w5 {' D3 L+ j
        wait for A_time sec
, V4 V& k7 A: n3 B2 ?    end
# ~+ h$ z1 s0 v+ r( @2 h2 u* yend
/ g, c1 b( W7 G4 R' ~7 i+ S$ A! s( S' I
begin P_induction arriving* G4 {# ]% H1 D% M& V! B
    if A_induct=1 then clone 1 load to P_pick1
5 V3 l2 N6 w# p: H# Q$ B; p    else if A_induct=2 then clone 1 load to P_pick2
4 v- c4 _  k6 S' z1 R4 n# q9 |" @. l) @        else clone 1 load to P_pick3
1 x+ x" S+ W5 d7 yend* r* P+ U+ @# O" Y
& f( ?( F' L* M
begin P_pick1 arriving
, ]2 n" y1 q! `* }; `& B( X    set A_i to 1
; `) B- U1 j% `    move into Q_induct1
$ `  U3 S" U# b    move into pickaisle.induct11 P/ U3 K1 F! s' [9 R/ @
    while A_i<=30 do begin" Z. t, I6 i  J8 c6 A
        travel to pickaisle.con(A_i)- a$ I, V1 E1 P) H2 a, X" O) L% N/ B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 h7 V/ P0 E) b1 q% E. X        else wait for 10 sec9 x! @% k2 b) Q1 F
        if A_i=A_leave then send to die
; l4 v3 ~; i4 a/ M* d! z        else inc A_i by 16 f: p" ?4 a& w6 Q* u* t' J9 i
    end- G; [6 s- g+ `' j+ X# V
end
& H8 m  A+ u- `) R& ?' S
) m$ L' n( K# S* v0 Xbegin P_pick2 arriving6 l, }: X  R2 q  M  p. |5 _
    set A_i to 11
! V" Z) H# e! L8 B; r8 j1 @    move into Q_induct2
- y- G: Y! [) c" X    move into pickaisle.induct27 {; C3 l  G' P  T( m8 |$ Q
    while A_i<=30 do begin" n2 W1 }, ]5 f8 ^$ P$ }; D! u& r
        travel to pickaisle.con(A_i)* {: k& B/ g9 n; x/ G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  Q+ a2 s& o, @. X        else wait for 10 sec
; y+ A' R& ~& X, Y; g% B. p        if A_i=A_leave then send to die
: c! H0 E) W! b3 U4 |7 n8 B, n3 l3 l% U        else inc A_i by 14 L* _& }4 u- Q0 ?1 W/ F) K: t8 p  z
    end/ M) F6 g2 w( \9 t( ^& `* Y* U
end
$ {$ m5 C. q" T$ K9 J% [
5 \4 J; _6 V6 M- }: P; Zbegin P_pick3 arriving
: V' D! l. M1 d9 a    set A_i to 21' C( I  d" N" o0 q4 o
    move into Q_induct3
6 d; t5 D& d: s" F8 C+ y    move into pickaisle.induct3; h- W4 Z. x2 v. R  q, Y) f
    while A_i<=30 do begin4 U1 @3 k: ~7 ~. G" ~
        travel to pickaisle.con(A_i)
9 c; e+ ~! w. i% P. e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ]+ V2 f$ |- w% e
        else wait for 10 sec/ d8 D$ r8 f# I- p
        if A_i=A_leave then send to die
- D7 Y9 V6 t  _8 Y$ x        else inc A_i by 1. a7 p) ~. u6 L5 r" K
    end6 m! Q6 a- D6 w+ J# u- k! v" y: v
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是个什么东东?- _& r) F$ Y0 L3 ^: d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  C8 d7 Z8 s, |; s! P. b
# `) e5 ^2 f5 J# U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" _, q6 Y; V. G. z# B: K4 a! a- H  }! \1 k2 u  m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 k; y% @: O5 Z4 u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ B  G) b9 I) O- d4 ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 a- n6 R  q7 T6 Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 M$ h7 w  c  J3 Gbegin P_induction arriving, |" U& f: n7 h2 `: ~
    clone 1 load to P_pick(A_induct). n, g( t7 m" D$ A
end最大的系
- J, x1 [" ]- D4 I
! W) x& W% Z% Dbegin P_pick arriving5 _3 d/ v- j" T9 \8 B  Q' Q
    set A_i to procindex * 10 + 1* w; @& g9 V/ J( T; O& Y
    move into Q_induct(procindex)
% E! E% i6 w. I0 h: G! M    move into pickaisle.induct(procindex); j9 `' o9 A# g4 w3 v! ]7 H1 ?$ v
    /*check the type of pickaisle.induct(i), for your last problem.*/2 H7 _3 n1 i7 d2 _* T

+ E2 @, G: ~* N9 D    while A_i<=30 do begin
& r! ~' m8 G. _' B        travel to pickaisle.con(A_i)( y, _) @/ w" ?2 K- S! c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, C( e9 ]/ n# H2 D        else wait for 10 sec/ v- ~) [* O* d& M' A; C$ s
        if A_i=A_leave then send to die
) l0 ~1 G; D6 G6 o  p  S        else inc A_i by 1
% B0 a4 a$ u8 S! M: i& G    end! ~" T' T% S) y" S
end' a2 A  Y# P+ L' g! S

% s4 a4 m' E4 J) f9 R0 S2 d其中的procindex为整形,代表当前process的序号。0 |  Z; V7 v& g3 {9 F+ H4 G& \
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-5-20 04:11 , Processed in 0.022918 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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