设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14086|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) @2 w, u  r( C0 x' S, b
, G3 O$ y8 v, v0 ~* W; B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  q1 D* a. ?1 {5 k

$ g. J& g+ H( p5 c2 Tbegin P_read arriving
$ F* @, {" @6 h1 B# E- w& E    while 1=1 do begin
# O' `  W( e# _4 i1 h2 i) n        read A_tote from "data.txt" with delimiter "\n"
" U0 P* d+ h% x' e0 O        read A_time from "data.txt" with delimiter "\n"
+ e0 K+ S( f6 Z/ E# u# |: r( k* p  ~' y        read A_leave from "data.txt" with delimiter "\n"
/ {2 s% g/ K# K        read A_picks from "data.txt" with delimiter "\n"! W' U8 i% c- d: Q1 U- l8 ]. v
        set load type to A_tote; S7 R0 N) F0 a
        if A_tote="tote 1" then set A_induct to 1
8 b7 ^$ }  w4 ~9 y  q# s        else if A_tote="tote 2" then set A_induct to 2
7 t6 I9 I' x0 \8 M. E/ o# Z            else set A_induct to 3   
: c) P2 ~+ o+ n: i        set A_i to 0& A2 ]. s: N: Q+ J! |) Y0 M# [
        clone 1 load to P_induction7 u. C. Z4 |5 }) t& _
        wait for A_time sec
6 ]8 v5 V$ P) t4 K+ B$ n% {$ }    end+ I) }' X( s. [9 m5 H4 n9 I" A' p
end
2 q8 X" d+ e8 Q. y' c, H+ a% q- d
begin P_induction arriving5 p+ N1 k& u0 y3 e/ x& z% J& z  u4 n
    if A_induct=1 then clone 1 load to P_pick1
1 `" Z; Q* ?7 {4 Q    else if A_induct=2 then clone 1 load to P_pick2
4 k  N  p1 Y9 Z% P# Y* ~" m        else clone 1 load to P_pick3. s9 l! W6 ?& U
end
* x" q1 a6 u, C- Z0 u
' s- s5 ]# t7 n0 k; kbegin P_pick1 arriving5 @" D, t, T6 M: G7 J" y& u4 @
    set A_i to 1
2 k# k  `6 q" ]6 Y) L6 ?4 P    move into Q_induct1: H  X! g  L5 t% J' J+ Q$ U
    move into pickaisle.induct1+ s% c2 F, s3 F" @
    while A_i<=30 do begin8 z( Y4 P( d: Y) Q0 W+ M/ y
        travel to pickaisle.con(A_i)
6 K/ f7 s! L1 C! m; m8 e# O! B- j. G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, m. J3 v3 _5 H, d; H" V2 J
        else wait for 10 sec
/ R* G" S* g5 ?. `  g. }$ d, m0 D7 F        if A_i=A_leave then send to die. V5 y) O$ C. a1 B1 F
        else inc A_i by 12 X1 S, R! R! x# ~
    end
# ~0 _# {  z0 Fend& w+ k  B5 P9 y6 z% c1 |
2 C( k3 k4 p. r$ N+ c
begin P_pick2 arriving8 F. s* l  k/ x8 m. k
    set A_i to 117 B5 q3 a+ h9 j6 f$ Y
    move into Q_induct2; x# V+ ]0 c0 j! _, m6 {/ n" c! p0 c
    move into pickaisle.induct2
9 V' f  E9 C% G  D* [6 t- L    while A_i<=30 do begin- x* |. T4 h& j: D5 a! O
        travel to pickaisle.con(A_i)
: o. Q$ m1 \+ b$ M0 z; I8 \7 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" v/ A1 e8 l7 |& w0 s: F% D        else wait for 10 sec3 Q1 v8 J6 Y2 X2 g2 ~; y
        if A_i=A_leave then send to die
& O) C& Y+ w1 o. |! D% i2 e        else inc A_i by 15 P* A! J7 H* T/ v6 U
    end
! B: v# H! @6 n4 s9 [: ^, xend/ N; Z# _- C" t
4 ?- z. s8 b, }
begin P_pick3 arriving# Y3 H# b( A- Z# j: m
    set A_i to 21
7 f) q+ j. n4 T5 u" }    move into Q_induct3
- y2 Q# A. X1 U( L' [+ D    move into pickaisle.induct3
2 t( _1 i5 G0 B) F! h  y6 O1 K    while A_i<=30 do begin
; V4 V3 Y! D5 `7 p4 M* T9 _        travel to pickaisle.con(A_i)
, X6 p' N$ n! s: z7 K' v! h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& A* U* t. d  B1 r. H' U; _        else wait for 10 sec1 H$ [0 C9 e; V  l
        if A_i=A_leave then send to die  n, ]8 a. j. @4 ^
        else inc A_i by 1* l: |* Q3 }1 W+ Q9 X  }
    end
/ n+ {9 t0 B* |  j) B- Mend

最佳答案

查看完整内容

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是个什么东东?
5 l% D8 p7 b2 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ `" Y1 @0 ?- ?8 N$ R
- _- t+ X# m2 o, u4 _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' z; U7 ^/ I3 Z) J
* N' c; X6 ^% j* D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% \8 F' j) a; ?7 ^7 F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ D5 x$ S2 K" u+ X  L4 X/ `9 I$ H1 s' U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 d$ f: n, f1 h" b" _0 L5 T0 d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, [! o' {8 P1 g& r. Z* _begin P_induction arriving
( A* Z; x( m  F' t9 x! k. M# b2 m    clone 1 load to P_pick(A_induct), Z( ^" y  E/ r; x/ `0 Z- \7 S
end最大的系
6 L" W3 G/ s; l; s& R! h
6 V( B0 G3 @& W8 f1 ~' r7 I9 \" Fbegin P_pick arriving7 }/ w1 H! Z# r$ }- M& B* c
    set A_i to procindex * 10 + 11 H# U. I$ p. m( O( K( W( {
    move into Q_induct(procindex)
, }/ n, ?5 U5 M4 z9 L$ B9 {    move into pickaisle.induct(procindex)3 y& M& M! K  J5 k1 p, r
    /*check the type of pickaisle.induct(i), for your last problem.*/
: s& U& B% ^& s' ]& k
: d' ]6 U" p8 U: Z6 J    while A_i<=30 do begin% F- y+ q& @6 x6 ~3 d) F1 Y" g
        travel to pickaisle.con(A_i)
2 y# ^7 I, ]* e- }+ b% |4 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" c8 S/ W7 q3 g7 t5 ~        else wait for 10 sec
# `' o& @0 I! g) m) K        if A_i=A_leave then send to die8 i5 T- X! E! @5 x, k) Y
        else inc A_i by 1
. m% H+ K' E. E# r- `4 H& _2 w    end
* [" R; z1 I9 }, iend
8 Y# {- w. x  h: {/ d4 w* O
+ m, Z3 Y4 L" @' u/ R1 p其中的procindex为整形,代表当前process的序号。' n- `! T: W% m# w# ]% O/ L+ C+ C
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-7 10:09 , Processed in 0.015965 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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