设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15637|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* f9 N# X. \" c/ y: k7 ^8 w4 \& b- P1 T! u* ^: C9 w" f* \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 y$ C8 `* \% M. m
/ X6 f" i  D& N  K1 o  @begin P_read arriving
2 i( t6 L5 j5 Y% y8 _' C; O+ Y, j3 C    while 1=1 do begin8 J4 y& e0 p: k% A+ j+ k
        read A_tote from "data.txt" with delimiter "\n"7 w+ S3 L# B3 d! I. x; i& X( V# V
        read A_time from "data.txt" with delimiter "\n"
+ t$ j" _# h; F( p4 t        read A_leave from "data.txt" with delimiter "\n"8 N) B2 D7 E) x' ~
        read A_picks from "data.txt" with delimiter "\n"
: @( B; e" W; k/ `4 y- n        set load type to A_tote/ i$ b- e3 R5 D& i' A7 M
        if A_tote="tote 1" then set A_induct to 1
6 d7 {6 p7 @9 e" |        else if A_tote="tote 2" then set A_induct to 2
0 k/ S: G9 I! j0 x            else set A_induct to 3    1 ]8 T& p3 P: P0 z' `9 T
        set A_i to 08 _% u' Q' b* M, p
        clone 1 load to P_induction& t) n! o* s  s. Y  M
        wait for A_time sec$ @' P- r" {+ \" o- R0 i! q& k
    end/ e* W1 v/ `0 E" v" w
end( t, S% u$ Z6 l3 Y) g7 Q
& K* ~( B# o, h3 T- z' b
begin P_induction arriving
6 @+ Q+ S% b" G; |. |1 _    if A_induct=1 then clone 1 load to P_pick1
1 c  [, y) A+ X5 u' J9 w2 u    else if A_induct=2 then clone 1 load to P_pick2( y! L& ^/ }) Z2 F) \  m& h4 W% L7 X
        else clone 1 load to P_pick3
( Q  e& i) x/ [& h' cend, G6 g2 A+ y: m: j* b
, j7 O2 Z' N" a. m# P* }& }' P
begin P_pick1 arriving, O9 q  c8 z+ [9 i
    set A_i to 1: E$ s, o8 K9 h& Y% j3 s/ X8 l
    move into Q_induct1
) M1 z) h) \3 c- v) E6 S    move into pickaisle.induct1, e1 v, `% R7 P# O9 k3 P# i
    while A_i<=30 do begin3 T- V; Y. m: {9 H9 W3 W
        travel to pickaisle.con(A_i)7 k* @4 ]5 K- F0 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ p# Z+ z$ w; V
        else wait for 10 sec
" {) c+ \' T/ u* y0 t        if A_i=A_leave then send to die
6 a0 F! y( i7 M7 m! [        else inc A_i by 1" ~# d, J2 k) ~$ G( ~, f
    end
, T. B" m2 S1 ~end
! K6 H' d% a, i
- c( j0 i& s6 Q* j! j* Q* Xbegin P_pick2 arriving
$ b2 U* R* a4 d1 j* x    set A_i to 11
; C0 E% c  O% {    move into Q_induct2
* Y+ l. G/ `/ N+ z9 n, i    move into pickaisle.induct2( y5 h) c# g; l. Q1 `
    while A_i<=30 do begin% {4 \# Y- M/ F1 T! u
        travel to pickaisle.con(A_i)
+ T+ O7 R8 }/ [# I5 i0 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* u& E5 |  \6 o8 ^/ c" r
        else wait for 10 sec; ?9 {5 i& n( m5 g/ J: l3 H. Q
        if A_i=A_leave then send to die8 l; q, B4 ~% N
        else inc A_i by 10 J" \5 x% K* z
    end
& {" b( d+ r5 H( g9 F0 Iend: z5 V6 v4 e# W- O$ z" i) Y' u

0 N+ S' ^( Y5 h# g% }7 X4 gbegin P_pick3 arriving
8 _$ X/ Z: k  n4 G4 }( x6 |    set A_i to 21. Y& I: t) h  \) G3 c' C
    move into Q_induct3
1 \4 n: j: d1 j: N. N    move into pickaisle.induct3
! e/ F/ }' s* S- b" h4 t2 f7 F  ]    while A_i<=30 do begin5 M+ \$ m3 L5 q6 }  }1 k
        travel to pickaisle.con(A_i)6 |2 E2 Y: J' K; I  ^1 n$ y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  P) L1 l- L& |  v2 g8 a1 ^/ J
        else wait for 10 sec
( n+ X/ ~  t; H+ n        if A_i=A_leave then send to die& s, K, Y5 p+ p& k
        else inc A_i by 11 _/ e  B0 X8 @* z5 s
    end
3 S1 C3 H* Q: x- K1 o3 Rend

最佳答案

查看完整内容

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是个什么东东?
$ L3 j. z# ?) r- t) {* A. o3 rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 Z. E/ z" H6 l* ]; |. [

3 G; w/ L, Y5 W5 N9 i2 {( b* bAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- ^, R2 z  f& c, F8 L6 X7 U* E
- a, o. Y0 F( ?4 P0 N另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- ]; D; o  V  h" d' L: M$ T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, k8 x$ t* d6 q. h! }( F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. m; X; [7 H1 ]/ F# G1 E& O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! k4 Z# F3 G' M- r. s# U2 m! D4 Bbegin P_induction arriving
: x  k) n9 n- D( |    clone 1 load to P_pick(A_induct)( K. ?% M$ H; |3 Q6 ?
end最大的系4 W2 T: l. z6 Z! `

0 K) E  l0 [# G! B3 ~( ~$ Q) F; ?begin P_pick arriving
) E( D+ ^4 J  g' I    set A_i to procindex * 10 + 1! U% s% [0 C/ ], F; D* @. G% ]
    move into Q_induct(procindex); M# p( y  J" W5 i
    move into pickaisle.induct(procindex)
# j* a2 U( M" P" Q( Q( H- U    /*check the type of pickaisle.induct(i), for your last problem.*/
( d: V! s" r% y  q3 [7 S: C4 b# J8 R2 }/ @
    while A_i<=30 do begin
1 A, k4 C! M2 }& t6 J  z. h% ?9 H( C        travel to pickaisle.con(A_i)
4 j& h$ K. `- Y5 q" d2 l' D) }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 O1 J- @, c7 Y' P
        else wait for 10 sec" L. i& l# @) [1 q* b
        if A_i=A_leave then send to die
- A( L6 D, m" d  t6 r7 O" S# S        else inc A_i by 1
: U+ O3 T* u& w2 ]# P$ W4 Q( u    end& V) Y" h6 C& M6 C! |1 u
end
5 ^4 Y. t. @8 N  }2 e/ p- U
& M% a7 r- L' ?; [" R) d其中的procindex为整形,代表当前process的序号。* j2 P; y/ O$ o5 I* |
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-9-23 15:09 , Processed in 0.015101 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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