设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12787|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. I! \9 E: s3 N( _% K# U$ M5 }  Y* ^8 Y2 R- P5 h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ n* z. l* d! L4 n# C# J

* x: m" y  k1 W: A" [* ]* }begin P_read arriving
" ~& Z, A3 a* V8 t5 X9 C    while 1=1 do begin1 X# Z! t3 ]: q, v. K
        read A_tote from "data.txt" with delimiter "\n"1 `: {  M& {" z
        read A_time from "data.txt" with delimiter "\n"6 P. o( V) H" ~6 |$ S8 |) y6 O
        read A_leave from "data.txt" with delimiter "\n"2 @% E3 K. R5 d
        read A_picks from "data.txt" with delimiter "\n"- U1 P8 R* U  K; `1 f, S
        set load type to A_tote
5 S& q' N' X3 {/ _+ x' M        if A_tote="tote 1" then set A_induct to 1. Z% A2 C% z# n# F4 K( q
        else if A_tote="tote 2" then set A_induct to 25 I' ?4 [' l( H
            else set A_induct to 3   
  C* y2 V9 @/ X        set A_i to 0
1 G% z6 M& S; B. j. Y0 k/ n" M        clone 1 load to P_induction! o6 b8 t" Q! V7 }2 e. ^: ?& D9 ]
        wait for A_time sec
- ~; E) ^) j) i4 C0 q$ C1 Q) G4 U    end
: E9 j1 Z  H/ ?9 w& Uend
/ N, r, ]7 ^$ U+ ?0 p; h) F: f# ^0 S$ g% c7 b
begin P_induction arriving& ], ]+ E1 l6 E- P% w
    if A_induct=1 then clone 1 load to P_pick19 @" K, L! N: Z* q, i+ L6 H( T
    else if A_induct=2 then clone 1 load to P_pick2- O% e# s) L! m, l! a9 U6 ?
        else clone 1 load to P_pick3
5 F7 B5 M; A! o7 Z; l0 Dend
& Z0 H3 {6 c: M3 x5 V; H3 \2 A; P- N- k  c
begin P_pick1 arriving
, y% q" g; {3 J% g1 a    set A_i to 1. V: r- ~8 H% z% P0 x' a( J$ J
    move into Q_induct1, b8 N9 Z+ G$ `8 K2 s8 @
    move into pickaisle.induct1
' ?4 N5 j, n# A9 X, z/ c    while A_i<=30 do begin
7 H% F' m$ r- o: n( u4 T9 a" @5 N' U        travel to pickaisle.con(A_i)+ r  F, C: o6 K0 ^# P8 c9 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( E. m0 }) V) a* _; c8 _        else wait for 10 sec
5 K! i+ G; n8 R+ x' N! Z7 G# `        if A_i=A_leave then send to die- c' n! u* S/ E+ S0 V% U7 j! j
        else inc A_i by 1
) s* v3 g& z" x, u2 c    end
$ d& d% n5 @( _* Q3 \# n& Send
8 K4 i$ l/ l5 i' h7 b8 r# L2 ?4 Y8 G
begin P_pick2 arriving
- k# J  G9 }% D    set A_i to 11. p- \3 u% _4 y0 k1 r" ~+ t
    move into Q_induct2
, C  Q4 k& P1 f4 I# F    move into pickaisle.induct2
( q4 p! P) H1 w1 r- _    while A_i<=30 do begin
8 ?6 ^; b' V- t4 u9 X        travel to pickaisle.con(A_i)
$ P* \, G4 c8 \% x' S6 r8 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ |  e" W2 Y2 i) @7 X        else wait for 10 sec
9 O4 A' g% k% ~1 N; e        if A_i=A_leave then send to die  Z: A4 _- q/ I" o9 ~2 N; Z! f5 `
        else inc A_i by 1: q' A  ^& M+ t. E/ i: O
    end
7 c1 k  t- f+ p6 s7 w, X& Iend
3 R( R# l: U: c, b- g5 V! v( |+ R( e% {/ A5 H& ?+ h( m
begin P_pick3 arriving' t! m* S3 v* E
    set A_i to 21
( h# x: v9 G1 P; I! k    move into Q_induct31 I; R& [% `2 k
    move into pickaisle.induct33 N- H7 q6 c7 C. C) }
    while A_i<=30 do begin
8 L- e6 Z. t, V; G& c9 ?        travel to pickaisle.con(A_i)
1 j6 w2 d" Z, z5 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 @& r- O% O0 ]% [! m+ h; V/ ~
        else wait for 10 sec
. H  \( U0 N3 F  Q' m/ b        if A_i=A_leave then send to die
7 o" E# d) G/ z6 }. L5 V0 C  a        else inc A_i by 1+ E" c. U$ k" i1 m) V  I5 s: Y. x! E
    end" H# f' y- M. v1 i: G% b! n
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是个什么东东?
0 S% v; {; x% Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# l8 e5 f. p6 x! w% A6 P4 a% b  `3 Y4 Y% v# Q: v
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" k+ L8 f' [) g; z5 n# D: a

: ^% f- H! i5 A0 s3 F, I! ~3 ?+ D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, L; N% F$ E+ j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 |9 B- Z  R( S) k+ U/ Y' C! d2 p8 m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ E3 ~- e3 H4 i; u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 J$ m6 ~8 n6 n$ ?begin P_induction arriving
. L, l/ x; T! J/ j4 ?6 t    clone 1 load to P_pick(A_induct)9 p. e* m/ X* U$ ]. C  M- q
end最大的系& n# |- ?1 N5 `5 ]2 v+ n' _' S* ?$ J
" `/ @1 c9 `$ x) z) n! P. z
begin P_pick arriving* P* Q% Z9 u9 ~( V
    set A_i to procindex * 10 + 1  v2 t, @) `, N" r
    move into Q_induct(procindex)2 Z7 K: m/ [1 ?9 z  ]) l
    move into pickaisle.induct(procindex)
$ K9 y9 ?5 O/ _% g, S! T    /*check the type of pickaisle.induct(i), for your last problem.*/
& B* Z3 R6 N& r9 B8 U0 v0 }1 O2 }
, m: R$ B; b+ S( E    while A_i<=30 do begin
! h5 J3 |, a1 B  i        travel to pickaisle.con(A_i)
) G; G0 G- M2 X7 n4 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G, Z# u4 s* @( J$ M* _7 O
        else wait for 10 sec
0 j- k0 H8 m" d' n9 F# ?, @; ]        if A_i=A_leave then send to die0 b: g: \/ w$ z( @! \3 y2 [
        else inc A_i by 1* y% _* L! A! S0 k. B$ B
    end
4 }9 p* R  A) e7 D% t0 jend' m' o9 S+ h/ ~  O0 W7 Y
, t! W$ V4 G$ u! G2 N* f; P
其中的procindex为整形,代表当前process的序号。$ E$ w5 F# Y  W
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-21 01:01 , Processed in 0.018380 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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