设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13173|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ B& ~! r  a5 G. B1 W" B! p' U! X. d" D, @
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 K1 Z. X& S4 u- H! p
$ @6 s: I+ E* t" s8 y) y; @begin P_read arriving
. g# F! g: ]' H* T    while 1=1 do begin
7 H- B2 w# _- g        read A_tote from "data.txt" with delimiter "\n"
  ~; V$ z7 \) `5 ^+ U( z7 e        read A_time from "data.txt" with delimiter "\n"
  m1 n& K# N$ h8 Q% W        read A_leave from "data.txt" with delimiter "\n"; b+ I) V/ P6 t3 y' T
        read A_picks from "data.txt" with delimiter "\n"
9 ^+ C; Z9 r# H0 c% S+ O8 j        set load type to A_tote8 J4 @) P+ `1 R0 J/ v. T2 o
        if A_tote="tote 1" then set A_induct to 1
& T. P6 M5 A  f6 }6 @( U- y: m        else if A_tote="tote 2" then set A_induct to 2  g, G  i: V' Y: H, T- i
            else set A_induct to 3    % h& F0 n. r7 B3 y
        set A_i to 04 W6 M  }: Q+ z$ b* D1 a+ d
        clone 1 load to P_induction
+ w8 m$ Z% w) t% e) d        wait for A_time sec5 Y; p& S3 _: u. j. R
    end8 r/ c$ V2 p/ e8 [) t, e. B4 w) O
end
4 s- N5 x. G; F8 c" ]9 r0 ~- y3 ?5 f
begin P_induction arriving5 C4 W% R* ^7 q
    if A_induct=1 then clone 1 load to P_pick1
* q$ Z6 v7 f* \; [' ~9 N    else if A_induct=2 then clone 1 load to P_pick2) b- D% o; r5 |8 W) D! @
        else clone 1 load to P_pick3* {3 I6 S3 y) C& o4 f
end
+ ?' g; Z( q9 A- ]& s
8 Y3 W1 l; X9 w! V2 e' Z' Ibegin P_pick1 arriving: j2 Y7 a3 A6 l  w; x( j1 G
    set A_i to 1. h2 `& e" O8 n
    move into Q_induct1
! X: X8 D, Z+ G2 k& _! R    move into pickaisle.induct15 h8 R* {4 ^3 G9 `
    while A_i<=30 do begin
7 o# S3 a5 t, q9 J% W9 u        travel to pickaisle.con(A_i)) s9 W: }+ }! Q) y. r. {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" H. |, V, t- Z. q; \( h        else wait for 10 sec: L4 a- _- P% }
        if A_i=A_leave then send to die
, C" e" |# c/ S        else inc A_i by 1+ W$ D4 n0 T8 R* }: O, |
    end
# u2 E! K. I" C: ]% F+ g" T8 ]end. o2 E2 O% A2 i8 I) {

) o$ @( Z! s+ i1 I* vbegin P_pick2 arriving3 j! b: y) B" A8 Z* ?2 s, N
    set A_i to 11$ ?" I) m0 p0 J5 H" E! w
    move into Q_induct22 b) x* K# F* P
    move into pickaisle.induct2
5 g3 g# P! V6 {5 E    while A_i<=30 do begin
5 X% Q1 U$ j$ _$ g        travel to pickaisle.con(A_i)1 j9 f! o! [  h8 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  k  |  t7 @: X, f! P0 @, X' }
        else wait for 10 sec; C2 _, E7 l2 V- v* A
        if A_i=A_leave then send to die- T1 E( G4 D5 k2 Q* ]
        else inc A_i by 1
, j$ b2 m6 ^; i+ x% k    end
; v' c( _% f, Z: P6 kend
9 X1 l/ s0 u* r4 g4 t
* }! a" V# t- y8 v0 _" Ybegin P_pick3 arriving
* I/ L  `8 m& q$ p+ J0 h    set A_i to 21
9 s4 d0 C' T1 p1 ]& g    move into Q_induct3% h4 ^. p+ u# V/ z* ~" y2 }3 z: ?5 h
    move into pickaisle.induct3
4 o# P9 C8 t: M  W    while A_i<=30 do begin& r8 Z7 Q( M; g+ v! H* V" p
        travel to pickaisle.con(A_i), ?6 [2 `3 b4 K# P$ k$ t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) t' p4 b* c1 c7 C1 U
        else wait for 10 sec$ g/ L6 r, z2 \) E
        if A_i=A_leave then send to die* K( g1 \: W3 `" K3 F; W
        else inc A_i by 1
% s& n3 ]1 f' H    end
# y6 I1 U: ^+ X- _3 q8 M$ gend

最佳答案

查看完整内容

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是个什么东东?: C" Y% ]) v: U0 f/ B& s$ v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 w: r. P' J  m5 H
5 v4 j, Y: T% }0 b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ g/ z& B5 H: z1 m* z( w
# y5 A- D' ], q& p- z& E6 j# `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% S; o  k& U3 {  v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) y3 i( D2 }2 k) {: S2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 D) |4 I; ~6 _, A6 G4 G* t" W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 e. z  O* N0 @begin P_induction arriving; Q9 }* r) G- o" Q! m
    clone 1 load to P_pick(A_induct)3 ?" t0 L4 e0 |7 C; F
end最大的系
1 X5 M- R6 f, f9 W* a/ I' D$ a; V$ s' H: m# y! F
begin P_pick arriving* @3 E0 l; s* b3 ]; ~) i
    set A_i to procindex * 10 + 1
3 Q7 J1 r1 E; V( L  u    move into Q_induct(procindex): Z! o. C! @1 M" v& d
    move into pickaisle.induct(procindex)/ W1 B* Y0 d. ^" y
    /*check the type of pickaisle.induct(i), for your last problem.*/$ o6 f5 v/ n# `2 R$ Z  s9 w
# w+ x; v& t  s2 j: R9 `" D6 x5 a
    while A_i<=30 do begin
- O, w3 b' L1 F6 f  z        travel to pickaisle.con(A_i)
- E7 J+ l- `$ x6 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ a" v; w5 }, R: I        else wait for 10 sec
4 ]8 e( S% k3 p' @" S" O        if A_i=A_leave then send to die
+ w) E& b" c- c$ U( X% C        else inc A_i by 1
1 U1 @  N# d/ x' @& v    end
) L; X" t9 o' n7 g9 j0 Aend
: _9 X$ e  l' c# S
1 a5 {. \/ w$ r4 C7 v1 D其中的procindex为整形,代表当前process的序号。
) e  F  X5 m) D# P5 Kstation和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 02:26 , Processed in 0.022299 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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