设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11925|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! p+ |' W' D3 }
% x. I* e3 m+ g5 |4 Y! r2 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 Y/ ~! O! B# Q, G4 A& z1 R, n: i: E" W6 x7 _
begin P_read arriving
8 N- P4 Y$ o# i: r( w5 q    while 1=1 do begin5 u; E8 S# s! L; ^
        read A_tote from "data.txt" with delimiter "\n"
  ^+ x6 @9 O# @        read A_time from "data.txt" with delimiter "\n"9 `0 x4 `: C5 n9 `# C1 E7 W$ r
        read A_leave from "data.txt" with delimiter "\n") g" F; Q5 u% O2 @2 ^
        read A_picks from "data.txt" with delimiter "\n"% W, m' y2 J+ O9 t
        set load type to A_tote; A0 l- W) Y% L$ X5 n$ z8 D; N
        if A_tote="tote 1" then set A_induct to 1% y. N1 q4 B" Z9 z9 O/ Q
        else if A_tote="tote 2" then set A_induct to 2; C  d: @0 |' z/ u
            else set A_induct to 3    " f( r# {0 {" I9 v. m
        set A_i to 0* a- }6 j* y* w6 Z4 B3 r
        clone 1 load to P_induction. ^5 o# z) R. U* Y# ]" D
        wait for A_time sec
9 \" {) b: v! x, J0 g    end7 Z! g: ~  \$ R. z! u
end
' u* t( G2 U6 U; Q6 J
( B; C% n8 P1 X6 d6 R8 ybegin P_induction arriving! y2 y9 w! G- a0 a  t8 h/ @& |. I
    if A_induct=1 then clone 1 load to P_pick1
+ x8 ~) y/ g# k; X/ E' C: D( b) i    else if A_induct=2 then clone 1 load to P_pick2% J& F9 M& O4 z! ]! x7 W- T# K- ^
        else clone 1 load to P_pick3  V& Q) Q  G) f
end
( Q0 ], B* p, Y) d9 S' o  j2 Z% p6 J; c3 r# \4 J
begin P_pick1 arriving
9 r% U4 V& u, l% z) p    set A_i to 1. A8 C2 H: C2 `- k: H. Y8 w
    move into Q_induct1
8 N+ o8 z& k6 D7 P, m    move into pickaisle.induct1
, q. t* @! [3 l' l- N    while A_i<=30 do begin
/ d: s5 ?( _2 u$ s9 f, y        travel to pickaisle.con(A_i)
' w# [9 n  v1 P* W# u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) g  R* N4 n* E' K
        else wait for 10 sec
2 [/ U" j" |( x1 V        if A_i=A_leave then send to die: c  ^% S4 Q# r9 ~6 j
        else inc A_i by 1' e0 I8 Y* y, ]9 Q+ X0 o, ]" W0 T
    end
. Y$ A7 x. H3 e4 g; Kend+ N& ]8 F0 _- n  i; B
# k: A( b5 q  m* V% g# v+ f4 S/ G
begin P_pick2 arriving
! M1 P0 @# p( Y% Y( W) U8 @9 p    set A_i to 11
8 [- Z- }: M8 P- K1 i    move into Q_induct22 F; ?7 {. h# b+ O+ o$ `$ h
    move into pickaisle.induct2
2 G' w  g4 E# L# M3 s; t1 X    while A_i<=30 do begin
: x/ L1 q& ~0 Y8 X- l4 G' q/ Q# S3 w        travel to pickaisle.con(A_i)' n0 K/ y1 N2 t1 ?! X. h* e7 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X) g, [; ~) P  i6 H
        else wait for 10 sec2 D2 f5 {9 Q1 V; C$ G8 m0 y
        if A_i=A_leave then send to die
+ t! t7 v: M. V/ N1 x7 E        else inc A_i by 1$ Z( C( [0 V$ \
    end8 T+ _6 N. y4 `- w6 L
end6 G% H! k0 h+ V/ ^6 \! d5 b+ k0 H

, F' X1 T* I. R9 p  z& g* Zbegin P_pick3 arriving# W% M6 Y2 e0 @( T/ R5 ?
    set A_i to 21
8 k* q, ?; v4 @9 y! B( M    move into Q_induct3. }; U# x6 i$ p9 a2 ?+ x6 H% X
    move into pickaisle.induct3
) f5 v6 Y3 `; d- @0 V8 c1 M# B% g    while A_i<=30 do begin" {1 L- n/ k( |1 o2 N- x3 S
        travel to pickaisle.con(A_i)
. |( M8 L9 S% [5 ^6 |; q1 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ^# x' e8 ?; e- e
        else wait for 10 sec
; S4 g2 w2 Q0 |. J( r. g+ a        if A_i=A_leave then send to die
- H: \- c6 O0 [7 \8 a& n. b        else inc A_i by 1
& _$ A$ z, l- l5 K1 X- }    end; d- [) H  G: s
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是个什么东东?
) d1 x! s3 ]- R4 g& \/ dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; c4 L0 r; g) }* Q
! f& j* `) ~& c  e6 _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  |; `; `, k; O# O
6 p/ H2 O! c( u$ j  Y5 m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! d  x  }% H& w6 I4 G8 |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ J/ m" h2 e( [6 _/ I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ B& a& E( A' d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ P* {8 Z3 G# z* c$ r- U( F
begin P_induction arriving1 H6 S$ E+ D7 j1 `' i" A" m' O
    clone 1 load to P_pick(A_induct)
1 J3 a4 i" @: A2 Jend最大的系4 [6 v/ E0 X; `: u8 s% B' d
& ?* F6 M" |; ^& i) O9 r2 x
begin P_pick arriving
: A1 [3 t1 Z* |- R8 f8 b* [5 M- Z    set A_i to procindex * 10 + 1
6 b" N# Y/ d8 q6 a6 h+ `4 c2 h    move into Q_induct(procindex)
$ B7 T, Z9 M/ M$ D9 ~' H    move into pickaisle.induct(procindex)
0 G. t2 Y* e6 t4 s0 @; ~1 V5 t    /*check the type of pickaisle.induct(i), for your last problem.*/% h# f* Y9 Q* k: d3 b- h
' F: Z% ]/ i* h5 W( t1 D/ L
    while A_i<=30 do begin
# ~( b- H+ x& G2 F' i7 _4 D        travel to pickaisle.con(A_i)
) u) e$ o$ a& Z$ Y! i6 E5 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }# S# n0 X' V
        else wait for 10 sec4 w2 ^7 P& B* M: z4 d2 P
        if A_i=A_leave then send to die7 C  t- y& a* i# j% l
        else inc A_i by 1" N4 `8 v5 R+ g  o
    end
1 M9 Q6 d$ [! b, {end
* m' U6 H: l) P1 b
7 z; a' Q; T( v5 W, _' {2 x其中的procindex为整形,代表当前process的序号。6 d5 d* V; G! w1 H6 u8 c! U
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, 2025-12-15 18:56 , Processed in 0.040761 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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