设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14122|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: S4 X/ f1 Y! J8 P$ K0 i2 W" d/ v  G
/ w9 W! w/ |; @我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, `3 `4 o$ k( W- W
5 [) @# l& L; Y5 I: t& X# _begin P_read arriving0 Q! [% r; G9 B" f8 J# F& x
    while 1=1 do begin" u- T& z& ?2 |) D8 @. E( R1 e( P; p
        read A_tote from "data.txt" with delimiter "\n"/ p! t+ X& T5 P; Z' p
        read A_time from "data.txt" with delimiter "\n"
% X, }% D! X2 n. |( f        read A_leave from "data.txt" with delimiter "\n"! y: S% p. }) G" a9 |" f7 I& G
        read A_picks from "data.txt" with delimiter "\n"
4 l; d9 L. Z4 b4 C        set load type to A_tote
* B6 N! M% N  b8 h! o3 z2 L        if A_tote="tote 1" then set A_induct to 1
% x3 S5 t- I7 F8 B& g        else if A_tote="tote 2" then set A_induct to 2( x- u& O5 C1 s4 x& n
            else set A_induct to 3   
8 H! s5 g5 W! g) A; d        set A_i to 0
' g1 R) s" d! m6 L, x        clone 1 load to P_induction! l' w" s/ P: v: v1 L: Y' U$ E, e
        wait for A_time sec. a3 _7 n' W( w# N# G2 t. E# Y4 T
    end" g7 L* j1 N* b0 c8 k
end  x2 X7 [+ W0 o4 ~# v5 A: m

  W/ B& l/ n! N2 A6 Qbegin P_induction arriving* Z$ x0 u9 m8 E: Y
    if A_induct=1 then clone 1 load to P_pick12 d- ]9 `2 r3 Y: p" @/ J7 O
    else if A_induct=2 then clone 1 load to P_pick2
" F. F9 N- t% a# D" [; c6 x        else clone 1 load to P_pick3
" Z. t/ n" U1 f# ]; h* C, U) s. mend5 Z) ^5 {7 N* |1 v" u6 o
' t" ?+ t, t9 d7 K' {
begin P_pick1 arriving
4 P% ^1 Z$ `4 [( Y1 X  y2 c. W9 [    set A_i to 1
& t1 m9 i; Q& [    move into Q_induct1: O/ N) R% I+ _8 f# `% Z; Z
    move into pickaisle.induct1
0 G) d7 R# `, a    while A_i<=30 do begin
0 e! D; T; }! j) }" \/ O        travel to pickaisle.con(A_i)
& q* y( N3 O/ ^! U: \/ L4 d1 ^6 E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 M1 }0 e. ^; Y& |' a
        else wait for 10 sec9 C6 R( J% d. W
        if A_i=A_leave then send to die1 z: s& L& g3 _6 V
        else inc A_i by 1# \: x. B5 u* ?, w  ?- z" `
    end( k+ z! L' S: Z
end5 p7 q# [) i1 i6 E% b

7 W. T. ]$ R3 k' x" B/ mbegin P_pick2 arriving
4 p1 k" E5 W) N% R' H5 a/ K    set A_i to 11
, t6 ^1 p4 R$ T( M    move into Q_induct2
9 x2 W! ~/ e3 A1 E$ V1 J) W    move into pickaisle.induct2
7 X1 U7 L. F5 r, ?8 L' o8 r    while A_i<=30 do begin+ p$ [8 v0 W& T! }( m1 ]  B/ S
        travel to pickaisle.con(A_i)6 B% q0 U2 \  G6 e- c& v, v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 y$ e* [# @- F8 b# q7 K/ X
        else wait for 10 sec
/ d5 E% d& |  x9 n1 {  P        if A_i=A_leave then send to die' V$ n2 U1 H* q
        else inc A_i by 1
- l" y, @6 }1 A' K    end
; `% o/ p8 C" _" L1 m  c5 aend
5 S! Z/ P& Y. `6 {/ v: s! _" g! z; u' N  S$ S& R: q
begin P_pick3 arriving# l: o; Q$ a0 o: ~
    set A_i to 219 t( @% d" v# K) |& _) S2 R( g
    move into Q_induct3
% \; F- R! @$ U* H    move into pickaisle.induct3: T' K4 w5 q7 t* t: _
    while A_i<=30 do begin" V& G/ l4 }% C+ @8 K- e' }
        travel to pickaisle.con(A_i)$ ^0 C! s& w# ?: X' `- k- v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- g0 _8 v+ ]! ~' l6 b
        else wait for 10 sec
% k. M( e% e! U- m2 f        if A_i=A_leave then send to die
6 l% ?& E# T0 K, o9 z" n2 H/ w        else inc A_i by 1
' q0 p  \; x6 q4 d" F    end
1 j8 b0 r( ~+ L6 M, C' ]5 X% Zend

最佳答案

查看完整内容

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是个什么东东?: y0 G5 V1 k4 P+ t3 `. e% |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( \( S  d$ G% a" Y
6 H: |$ \# |9 p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; b5 g* t+ |% K. ?& p/ q4 o
% m- Z4 f% t, @' ?4 l. ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( _' m7 Z+ `! }, ?' I9 i% r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& d  t7 y6 q  v3 U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ i, {3 }1 B8 L; O  _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 I6 u$ @7 X# x) R9 L+ }begin P_induction arriving1 p0 i  b# @6 _1 k  d, L5 ^
    clone 1 load to P_pick(A_induct)1 V- g! Q+ G7 J( x  ~
end最大的系
  q/ E. I1 z. K. W2 y& [6 Z! ]2 t  z6 S  P7 L' I  y
begin P_pick arriving
, k: `$ W) q5 w    set A_i to procindex * 10 + 1
9 C& B: Z5 u7 J) ]    move into Q_induct(procindex)
( A1 g7 E$ i" s: G5 T* N    move into pickaisle.induct(procindex)
- S$ t& G' `: u    /*check the type of pickaisle.induct(i), for your last problem.*/( G8 N3 J! Z" k/ {% @$ M

& L  ?! g3 {: ~6 S% }3 S. K    while A_i<=30 do begin
. |1 Q, w3 a' P        travel to pickaisle.con(A_i)
/ p7 S& P% o) V$ U1 Z- C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; C8 s, S  D% d; i: s; g2 B
        else wait for 10 sec
( n# Z/ R1 G3 E: w        if A_i=A_leave then send to die8 ]. o! Q: S9 Z
        else inc A_i by 1& p; ?$ f" Z# ~/ ^' `5 Z* y4 L
    end
0 c# k& V# |- Q3 }7 o1 Fend  N6 {, S4 ]* P, g! j# D2 \( G
$ M/ ]% e7 A( y( X' \: a. n
其中的procindex为整形,代表当前process的序号。$ l# t( k! N# K" F# u6 Y( y" P
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-6-11 05:56 , Processed in 0.018383 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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