设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12854|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 k3 U9 F& I  c: f% s4 q) r9 J4 }' q# Y3 K2 G% b1 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! w! e0 Q, m9 z! x
5 E5 A: ^- }) Rbegin P_read arriving$ r7 p) A. D) k
    while 1=1 do begin
0 Y% u! N) z& z) i  ^( a' [        read A_tote from "data.txt" with delimiter "\n"1 z; s6 w4 ]4 y0 a3 W- q
        read A_time from "data.txt" with delimiter "\n"1 P+ ]: O7 Z5 J9 }9 ~
        read A_leave from "data.txt" with delimiter "\n"& c; v& }9 C5 _. I
        read A_picks from "data.txt" with delimiter "\n"; Y; a. M. d& v/ Z$ z
        set load type to A_tote* Q9 W# R6 S- T- @
        if A_tote="tote 1" then set A_induct to 1% U# A+ U& h7 Q$ _6 \
        else if A_tote="tote 2" then set A_induct to 2
7 L4 G; o- Y8 T* v) u6 c, n9 Z            else set A_induct to 3   
# C6 {7 m8 W6 X9 Z' ?/ r        set A_i to 0* ^! P8 _" k+ C  S5 ~
        clone 1 load to P_induction
$ k# s# d" e) b# `        wait for A_time sec% A4 B- e* N( \  ]0 K9 N; u8 v
    end
2 a: H& U( Z1 o$ H6 y, vend' T4 b! `7 f2 ~

, G) l5 J' E5 C) L7 ^3 r5 dbegin P_induction arriving
4 h( |# n; ]4 P7 [    if A_induct=1 then clone 1 load to P_pick1) g# L# n# \+ O5 N2 U5 J
    else if A_induct=2 then clone 1 load to P_pick2
% [1 z, e0 r/ _' w) v        else clone 1 load to P_pick33 {  z$ s6 l# I( b
end+ a& G, t6 w$ _5 `% T6 H$ c% m; ~

3 d7 U% ~, w$ N2 J6 Nbegin P_pick1 arriving8 E( @7 @/ A/ ]' I; K+ p
    set A_i to 1
7 ~& a. L, |* V  Y% q3 z! y! t    move into Q_induct1  A  O* y# p8 }! P
    move into pickaisle.induct1
! y. a( n) Q+ R! g- S3 y" N" ]! h    while A_i<=30 do begin( H' `% H; m; \3 }# O. _
        travel to pickaisle.con(A_i)
$ b9 Q% L1 k2 I/ d4 R& ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 l# N  a2 _7 ~        else wait for 10 sec1 b, j9 Y6 ~4 _4 u9 J: B6 d
        if A_i=A_leave then send to die
6 `. \6 v9 e6 |- R/ W        else inc A_i by 10 E4 A3 X7 v' A5 P" m. z+ H
    end
9 ]6 r6 B: k4 D8 x# Fend4 W6 X* x& [* i" }5 A% _* B) M& C
8 L6 n7 k5 h- O0 k  \. {" C- Z' v
begin P_pick2 arriving/ e. @9 M2 C: `, c. L9 ~! T8 Y! o/ @
    set A_i to 11
$ z- u9 q6 H, r    move into Q_induct2
$ h# @7 h, j0 h5 R' o/ B2 d" m0 D    move into pickaisle.induct2% y3 u1 R+ e1 i6 o, J
    while A_i<=30 do begin  s2 d- \! p* Z/ J! ], Q; K
        travel to pickaisle.con(A_i)
! K& @" L6 `* t- Q& l3 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) S6 s8 A. U: g        else wait for 10 sec. R& f6 z9 F* S' e# ?+ j
        if A_i=A_leave then send to die
" m; o* G% `8 `6 ~        else inc A_i by 1
) f9 H* f% R7 J' D    end; N7 X# a5 q% y7 g7 @# f5 ?
end
; h$ u5 C" Z6 u/ |, D0 V2 W  ~8 }2 A' h6 f9 _
begin P_pick3 arriving* e) z8 Z% X2 T! M5 ~* x
    set A_i to 21
! q4 f: f9 [" }) I    move into Q_induct3/ Y* ]! _7 J" ?0 k3 O
    move into pickaisle.induct3
1 p% _4 v2 X& V: `$ P    while A_i<=30 do begin
. e/ i6 B% |  }! X' V        travel to pickaisle.con(A_i)
6 P) n7 v' N2 L: I4 u% b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P9 [  V0 r4 s( A3 H( I  D
        else wait for 10 sec; K8 c' g4 F4 F1 `( }
        if A_i=A_leave then send to die# x* U4 K; B$ q7 r
        else inc A_i by 1# _2 @: h: G8 T  O
    end
2 t; `( x, U- y- \0 S4 Z9 D2 tend

最佳答案

查看完整内容

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是个什么东东?: J% Q+ ]0 O" [2 {2 ^+ I' ]
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 I$ c1 ]& ~5 Q7 v6 \
' V8 y9 h5 S' W7 O- U+ [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! H- t/ c) x9 \  W; |9 d

; r0 \# a9 f; r+ x( h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  u% S/ g& ^' a% S- o8 v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) C# r! B$ \* m2 g0 k' h3 A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 P" W, i7 K2 i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; G6 K  i* P4 h* p7 \' o: U
begin P_induction arriving- n$ ?3 @6 a( T1 X0 y& m
    clone 1 load to P_pick(A_induct)
) v" N0 H! f1 R/ M& {9 `! eend最大的系" @" @  M% B$ n# V$ i8 c

5 X7 M* s3 S. x" L7 D! nbegin P_pick arriving' }; r' Y) C3 r3 j: j6 Q: O& E4 a
    set A_i to procindex * 10 + 1
6 F7 D9 S7 v  I) C8 K- C  K3 Q    move into Q_induct(procindex)
/ u5 ~9 {5 F/ i, j    move into pickaisle.induct(procindex)
9 K, J+ Z9 S& }. p; M    /*check the type of pickaisle.induct(i), for your last problem.*/
4 Z+ w! t( x8 A7 v  a: j2 B* `( O, G) x- J2 g/ {$ `( E
    while A_i<=30 do begin
6 S" p3 W9 q' T6 w+ G        travel to pickaisle.con(A_i)
  L8 d! M6 p+ o3 A, w4 S% x3 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# U% a7 p. D3 Q& s( z" B/ }        else wait for 10 sec
, y- w0 S! e4 ~" r9 Q        if A_i=A_leave then send to die
& D% Z+ s4 n# f        else inc A_i by 1
, i- t+ n2 x, b/ R/ x! |    end3 o4 v. ?8 N' i+ M) k0 C- g: e' T
end
/ z% u4 Q( {; f0 J7 ?- O' A" O* F0 I, F% T
其中的procindex为整形,代表当前process的序号。  y+ u* F* f+ ?2 n# G& I$ D# u% g0 ]/ t
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-25 01:56 , Processed in 0.021076 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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