设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14082|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; ^3 w% ~7 ^5 H% _8 s
# `, N2 e( _1 r我的问题是,在每个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中的数值,不知道会不会有什么不妥。: ]. n, k& ~* e

/ E2 w5 \1 Q. {8 C- X1 Abegin P_read arriving
' o: c! z0 g2 g, g    while 1=1 do begin) m. Y( t; s- z: w6 o- a# z
        read A_tote from "data.txt" with delimiter "\n"6 Q% h% R) I8 \  g  x; w
        read A_time from "data.txt" with delimiter "\n"
5 V  W) w6 r$ Z        read A_leave from "data.txt" with delimiter "\n"
, r3 t+ G% |" o4 k0 x        read A_picks from "data.txt" with delimiter "\n"
5 k, O5 S% ?. x$ k& d        set load type to A_tote# V. a! s( N: k
        if A_tote="tote 1" then set A_induct to 1# V) Q, w; E( X3 g: g9 [; f# A. _
        else if A_tote="tote 2" then set A_induct to 2, m; U! g6 Z1 Q7 h. {
            else set A_induct to 3   
, C' P' z& ]7 Y8 H# M        set A_i to 09 e5 |. }7 y9 H+ n
        clone 1 load to P_induction
' w1 o# O0 ?2 C        wait for A_time sec( w5 ]! f6 a1 k
    end) B' S1 \7 U& s7 p' Z
end
& |: }9 |3 x3 s, i$ ~$ g8 {' j$ }
9 d* p; t$ q  `" y' K; M: g; sbegin P_induction arriving
1 o. c3 n! k7 a& }' R. y    if A_induct=1 then clone 1 load to P_pick1: l) N6 a. V9 u' U8 X) b5 V2 T* ~
    else if A_induct=2 then clone 1 load to P_pick2
- ~2 v6 d! G) [/ D. q        else clone 1 load to P_pick3
# y, Y, o, E) _" o/ {0 v6 j  \end+ O7 E% m' o, I$ S: h# ?

5 X: Q- p: E# f/ Xbegin P_pick1 arriving! h9 k5 g$ C0 f4 l$ F; O' p
    set A_i to 1
5 D8 {: \3 j1 `0 g2 {    move into Q_induct1% b; B6 @# I# I. K
    move into pickaisle.induct17 _4 b  g7 q" s2 p
    while A_i<=30 do begin
. m, p  `, [; N, i; @        travel to pickaisle.con(A_i)
) Z  K+ ~' {9 v0 K( |7 _  ^: G# T) l6 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 a" K7 ?2 l0 M, B2 z9 ^        else wait for 10 sec; Y& v" z% j7 K
        if A_i=A_leave then send to die
6 \+ Y: ]$ Q" ?; U$ B6 q        else inc A_i by 1
2 J/ c8 U4 x3 l7 s2 N    end
6 O6 t, |' }/ D+ C& w- ~end
" R. x7 h; ~- i/ }0 M1 M2 G$ c$ G
begin P_pick2 arriving
2 N3 f$ Z7 V- u0 W5 s    set A_i to 11
1 \7 O6 e6 h% N3 e) s4 h: o, [# D    move into Q_induct2
' R1 @, s6 y" C7 E3 h    move into pickaisle.induct2* V* f$ g1 D; d; a8 W+ r  F
    while A_i<=30 do begin
* U. l: G0 \1 y! s4 y- m        travel to pickaisle.con(A_i)$ V$ K6 o; u! \2 p, V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; o. O$ d' j# i* T. E6 V! C
        else wait for 10 sec( x6 j( Z( q3 w# j: |
        if A_i=A_leave then send to die1 a/ }; P- \0 U; `0 g+ d2 a
        else inc A_i by 1" d/ n: h* i/ ~% A4 F
    end9 ?; D. d' q6 K8 v# n# {
end8 }6 i* U5 D5 S6 w; Y" d4 f
1 D; o  P6 U5 g
begin P_pick3 arriving
& x7 H0 D+ a3 e2 ^- x    set A_i to 21' L: s9 J4 ?8 I! o( G( ^" ?7 d
    move into Q_induct39 s/ O8 V0 Q6 W$ I+ x; m# K+ o' N
    move into pickaisle.induct3" @' ^% |) E6 i+ g; k* _% r
    while A_i<=30 do begin/ ~  j/ {& J. c& u0 T
        travel to pickaisle.con(A_i)
2 |  z  D6 Q% b0 ~6 ]8 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, @/ c4 s  c5 ^5 B
        else wait for 10 sec( i+ r8 M2 s8 M, |3 V- y- a% u8 z
        if A_i=A_leave then send to die+ X& u7 }- X2 _3 E/ z9 G
        else inc A_i by 1
0 ?3 K1 j. S  {7 p+ Y8 G    end
. b$ A( K6 ?( k# J# N7 W5 aend

最佳答案

查看完整内容

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是个什么东东?
1 A! `6 O' g# n2 imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: j# o  N  o% K9 k) L( b0 K# Q
) l: _9 [& H! f  ~1 v( IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) b3 q9 a2 A" B) J- _

) t- ]/ z: J4 o  h/ I另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ b+ m# E' ?' f. p: r# {
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  n$ a9 u% o! q7 o8 B5 ~; [0 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 R' }0 N% D) ?1 j( k( p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 L7 }! J- {6 @: q7 H' \! mbegin P_induction arriving/ G. ?/ d( q2 k  O6 J% E6 f# l5 z
    clone 1 load to P_pick(A_induct)
0 Z& J9 k- k5 ]end最大的系
$ \3 p9 b* P) P7 a$ A1 h0 ~: c1 o- }  s6 P
begin P_pick arriving
$ T# o2 i' s4 ~6 X) U" i- B    set A_i to procindex * 10 + 1$ J( _6 K$ N$ a0 m
    move into Q_induct(procindex)9 [8 a, M7 G  [, o6 b3 s
    move into pickaisle.induct(procindex)
% L, y. e8 [  W5 h& s% R8 T    /*check the type of pickaisle.induct(i), for your last problem.*/3 F/ b' H; P: L) L0 J# m' F4 \# e

- {' \* ~. P5 M$ O    while A_i<=30 do begin
/ ^, }7 b' G8 u) S8 F        travel to pickaisle.con(A_i)) D& V& P( P3 b$ V5 O. z6 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) Q( r9 @& i. Y' l3 }# c        else wait for 10 sec% X% P; g2 l5 g1 ?) Q
        if A_i=A_leave then send to die
5 o8 c3 Y; p( r        else inc A_i by 1  E. R+ g3 @: K# i" e; J6 C' u
    end& ^# O7 D3 k! E4 [1 S0 o. f2 L
end
5 `. `8 I' p8 y# g$ C* R
  {9 g: K% }# ^0 ]$ Q其中的procindex为整形,代表当前process的序号。1 Y0 s+ F& A% u5 S
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-6 16:58 , Processed in 0.015711 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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