设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15351|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. s, J2 ]' D& W$ H5 ~
+ H( t  z' u6 `- P5 A& l+ T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 e& C- I3 d# \1 T! F% o8 p" A. ]7 V7 S( E! p+ O
begin P_read arriving
4 ?8 s7 _; g6 G" i) ?& W" Y1 o    while 1=1 do begin# `" V, A/ ~+ ~
        read A_tote from "data.txt" with delimiter "\n"
1 p; p3 v+ s9 o, \        read A_time from "data.txt" with delimiter "\n"
' _# L9 w" A+ j% l4 }' d        read A_leave from "data.txt" with delimiter "\n"" X# P6 H! d. O- l$ x! J/ I9 B
        read A_picks from "data.txt" with delimiter "\n"
2 B, }! s' `* Y) R4 T" E' M; J        set load type to A_tote' i( |+ N& o4 ?
        if A_tote="tote 1" then set A_induct to 1$ Q  j3 R* t+ D" \
        else if A_tote="tote 2" then set A_induct to 2
" w! X" t8 j& J" U9 N* a; r0 Y7 W            else set A_induct to 3    & ^/ p" A) F- [/ F$ w
        set A_i to 0
" `) T# k; l  r5 X  Z8 |# J9 q        clone 1 load to P_induction  c9 J% y/ F. Q/ E6 m" W
        wait for A_time sec
* l2 ]9 A  @5 A  {7 ?2 M& Q    end4 X! D/ x  g  S0 y" q' T5 A
end* t5 x- L' }4 x9 G
- Z3 t: h$ H' Y) _
begin P_induction arriving
" \/ A' O% A" [9 a    if A_induct=1 then clone 1 load to P_pick1+ D% V" S1 ?9 k7 w7 o3 T. _9 {6 O
    else if A_induct=2 then clone 1 load to P_pick2
. H) Q- \$ a0 W: ]        else clone 1 load to P_pick3
5 @% D% Y' W$ k  x. g- u; r4 h: Y. ?end
% m  \+ R4 p) ?8 f" e7 g
6 h" r% ~7 O4 s$ F1 j; Y$ C7 kbegin P_pick1 arriving; o: Z+ X& `+ Z, [  \0 }+ H
    set A_i to 1
; {! u: o6 T0 m) |& O- u& n    move into Q_induct1; x* l8 P( s& x/ Q" p( F5 g' O
    move into pickaisle.induct1
9 R- F) d! g/ ^8 b4 t' `3 n/ J    while A_i<=30 do begin+ N' A! }) Z- m- V& z/ z+ _
        travel to pickaisle.con(A_i)  o+ c0 ^3 d! p; M8 D5 O5 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Z5 c* u/ S6 K$ ?) m4 I$ m3 P
        else wait for 10 sec1 a/ W3 p8 V1 i% a& R# G
        if A_i=A_leave then send to die
9 Q/ o0 R9 }% r* Z7 `& h' L        else inc A_i by 1
5 h8 \( p0 N. K6 C' `    end
3 |5 X7 F" \  d* ?" ~8 D1 ~5 _' D( tend3 _7 b: ?6 I& z
6 v0 {2 n: N8 t" S2 _
begin P_pick2 arriving. b; m" C% `6 M
    set A_i to 119 ^+ H1 [& {0 S/ {) O
    move into Q_induct2
) z- s; I. X" t" R    move into pickaisle.induct2# h8 s8 I; N* B% C: F! W* ~
    while A_i<=30 do begin
7 n+ d, U0 Y4 h/ \- L( U2 R        travel to pickaisle.con(A_i)
7 @# c* c5 X! S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# W9 ~" ?/ w% r% f* m
        else wait for 10 sec
$ R! Q% v4 s& \% |. G( S        if A_i=A_leave then send to die
, ~" H- h, e% `' W3 I' K2 y        else inc A_i by 1. t& M  U. w7 ^" _$ X2 Z
    end. Y3 z, I. `: G6 {  I
end
" q' @& p0 f  Z) r% h% M' ^: B: K( \( a# n! j% e/ ^6 _7 t
begin P_pick3 arriving
/ Y4 @$ p8 P) m+ l7 t3 [    set A_i to 21; P7 W; W, {1 ]  k7 F. Y3 o; O. F
    move into Q_induct3
( U; W( t8 J1 H  f8 _/ w    move into pickaisle.induct3
! B' x( e8 K1 h8 e    while A_i<=30 do begin2 E3 p# Z5 B! j8 @/ y4 Z
        travel to pickaisle.con(A_i)
# W0 O$ i) E. t0 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& n' k, e$ _7 n        else wait for 10 sec
, `6 K! q) I$ t6 |' @        if A_i=A_leave then send to die' W3 L3 `8 i/ G6 B$ y: S9 f6 R
        else inc A_i by 1
9 o& y+ f, b' \    end
% s: l/ h1 l# @; @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是个什么东东?
, [6 D, [; N# E( amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 d& j3 c- J( f3 r

6 v) _7 w% ^2 b1 c4 J4 _8 qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 e+ y1 q* ]  D' z( V
6 ~5 m$ z8 O  r$ W0 e* T6 Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 I% u+ _: G$ u- n# y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' T# r6 p* O+ D# d& {# u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( C, F" L( v  M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' _/ x7 O5 X0 D2 D
begin P_induction arriving- @. `. K% l) s- ^
    clone 1 load to P_pick(A_induct)+ z* e) P6 F' F9 G* e5 G$ o
end最大的系/ s4 E, ]9 @4 c( e9 L- }- i
! V4 [5 E- S: @5 R
begin P_pick arriving
, l+ {% b8 L  u( y( ^    set A_i to procindex * 10 + 1
% r5 `" B. f3 X2 i    move into Q_induct(procindex)
6 N& l9 f5 I/ c  i  D, C& Q    move into pickaisle.induct(procindex)
9 R5 ^9 y% t8 C: V- y/ n    /*check the type of pickaisle.induct(i), for your last problem.*/
0 L1 D& h  ]" z
* l) x8 L0 r7 f% Z3 u" x    while A_i<=30 do begin
" X2 U0 v5 Q  P        travel to pickaisle.con(A_i)8 X7 U, Z+ u2 M3 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& E: N! A6 w1 h: C" ]
        else wait for 10 sec2 v3 g$ I; w$ h& i; `
        if A_i=A_leave then send to die
/ R7 S$ _- P* P) l        else inc A_i by 1
9 }, O1 C; n! L( c* Z$ E    end7 s7 g7 @" Q1 A1 }  R
end
4 c- X' B1 |& N- p# X: B: r4 E0 Z) l& T$ S5 k$ |% ?% r- v
其中的procindex为整形,代表当前process的序号。
. l! G+ ~4 ^" s  w' d- g% 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-9-4 07:46 , Processed in 0.017379 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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