设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14728|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; s8 z$ M. h7 n2 i  V+ Y  M8 W
; Z- Y8 H1 y4 u3 @* s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ X6 z. u% z7 V+ Z5 L* D3 V
" {/ M. V. H8 n1 Sbegin P_read arriving
6 R! Q8 T5 ~2 A    while 1=1 do begin  f# R* |! u8 \) ?6 X/ K
        read A_tote from "data.txt" with delimiter "\n"
, O2 J6 g" D5 H2 N, q# y1 B( G% q        read A_time from "data.txt" with delimiter "\n"( v7 S: r$ a3 j2 h7 ~2 p
        read A_leave from "data.txt" with delimiter "\n"
5 d& @# @/ n1 n/ @" X        read A_picks from "data.txt" with delimiter "\n"3 b2 @* K1 G+ v( N' i7 p
        set load type to A_tote
1 w" k2 O3 u# f        if A_tote="tote 1" then set A_induct to 1
( A9 Q! o# E$ [+ v' M        else if A_tote="tote 2" then set A_induct to 2
' t( J: J$ j% G5 s: R            else set A_induct to 3   
1 G, r7 g/ s$ @3 |% L        set A_i to 0* d8 h  u& m+ v% d/ h; F9 J
        clone 1 load to P_induction
1 v0 N2 T& A, F* k4 R        wait for A_time sec  v% v1 T. p& }' e  o3 c2 k; k
    end
. \5 ~  o8 f% w: u* pend; l# W# A( n( e: k4 ^
8 x& C0 H+ O+ I+ y+ M% ^
begin P_induction arriving) O5 {6 a1 Q# |8 A3 I6 O
    if A_induct=1 then clone 1 load to P_pick1
) a1 f) W+ C4 @  q" Q* l    else if A_induct=2 then clone 1 load to P_pick2
4 E( p% z8 M1 K) S9 W) W        else clone 1 load to P_pick3
1 J) g# \$ V) J2 F8 b$ Cend+ v1 U: S. A5 Y# O. q$ v

( x% K" O0 c6 S# Z+ Bbegin P_pick1 arriving6 W( M% H! X& w9 h. G5 u; Y/ f. ?" y
    set A_i to 1. F% B: \( G& a9 P1 d  @8 a) `# I
    move into Q_induct1; O6 z- ?8 e5 k0 s: I3 p2 G: X
    move into pickaisle.induct1
, p9 C) L  F% W: d9 F( D    while A_i<=30 do begin
- |+ x8 I1 _9 Y0 Q+ `" J        travel to pickaisle.con(A_i); z- m" m8 R- L# s; j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. [. @& ~3 ]  O        else wait for 10 sec- T5 j/ p3 r8 i( }: M; Z8 q) _8 x
        if A_i=A_leave then send to die
0 u" k6 z* |# E. X! m6 P/ A        else inc A_i by 1
9 G- y% B+ ~8 ^. o0 A' m    end, l( n, B9 i! d1 Y  |0 r( t
end
" `) O% o  g9 x# F, \5 s1 C3 g3 \6 D. F+ c* b
begin P_pick2 arriving
2 ^' G1 ]3 s2 ^- Y0 ?. ?$ q8 r: |    set A_i to 11
- D* G2 |9 ~* c9 e2 v: t    move into Q_induct2' L" _9 j+ `4 _$ b) l5 z) E2 Y6 D+ @9 r% w
    move into pickaisle.induct2
, y2 o, X5 G; M/ h    while A_i<=30 do begin
/ _% D% L( R- L) W        travel to pickaisle.con(A_i)
7 M$ l; F2 e- k8 `1 e; v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& G$ P$ F  b) R' a9 M) `% d, ^        else wait for 10 sec
2 Y4 c+ O! T3 p8 Y! w. I# f  j8 y        if A_i=A_leave then send to die2 Q8 h+ H/ G! K0 j
        else inc A_i by 1
' X5 S4 L# C  G    end5 Q6 W3 ~1 h6 n6 X- b6 H* X
end
2 `* r1 ^$ n" B5 f. l7 S0 y7 B' x  G
begin P_pick3 arriving
+ T9 z2 i& I8 r# [    set A_i to 218 i8 @# G  Y0 f$ S$ R1 H2 l! K
    move into Q_induct3
1 F+ @7 ?" o6 |; n    move into pickaisle.induct3; y/ f4 w6 M3 @  g2 _
    while A_i<=30 do begin
7 T$ Y) c9 B0 S        travel to pickaisle.con(A_i)
/ A; m' @4 f& P( O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 S. h& X% Z' L. K5 |" [! ?
        else wait for 10 sec# L& N/ i4 N6 F
        if A_i=A_leave then send to die6 u; a% a. m5 s5 s/ i, Q- i9 E
        else inc A_i by 1
' Y5 \. G5 r9 C/ f    end! Z# d  r; L- ?4 ?; G8 z
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是个什么东东?: W1 t, y- h0 W. s/ u" ]
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# s5 I( g! _& C, T1 _) m+ C4 W7 C2 |! t2 \% O5 c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) c# _7 o& f+ O* q/ V  |. X

( {  K! j' G" u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* _' c. `% d4 p- }. `) w! U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% }: T& X( u* F/ r! N) w6 C6 H
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 h3 e8 ~; C* ^' t: _/ A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. b4 u0 t* K  I% g
begin P_induction arriving
. I& f/ ]4 {. q/ c    clone 1 load to P_pick(A_induct)/ w2 H+ G% N& V% D" M2 j
end最大的系0 L6 u: c7 U) _2 X7 a& S

) w: L% S% c( j) R( X% s' kbegin P_pick arriving4 ?' k6 C& y' X4 U
    set A_i to procindex * 10 + 1
* u+ l/ L( }! i9 |; G% r    move into Q_induct(procindex)5 H+ z  n4 z2 ~# a5 z! i4 l
    move into pickaisle.induct(procindex)
2 o& V; u8 G7 d& @) M- l1 V    /*check the type of pickaisle.induct(i), for your last problem.*/
" H; q: T& j. q2 P9 i
' V( \3 Z% n, T, d; C- w; y/ u' |    while A_i<=30 do begin
! @. {" {! ~  @& p. z        travel to pickaisle.con(A_i)
$ ~7 k& f2 [+ u2 c$ |* o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& y+ u0 h( ?9 C, L6 f3 u% `        else wait for 10 sec* r2 R; J+ y. u$ K9 k8 R- C
        if A_i=A_leave then send to die
' D& y7 M2 R. ~, ?        else inc A_i by 1% E* O1 h( @7 P' ~, A  t
    end- s3 |5 o* i: |: v7 \! X. _% y
end
7 c8 u2 O3 d# c8 n
* H, q& G$ p4 q* h其中的procindex为整形,代表当前process的序号。
2 ?) O- y% E+ d6 l3 f8 _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-7-23 18:20 , Processed in 0.017985 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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