设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14463|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ T4 `; b8 h( e, @0 y
% x" x, O( E3 {3 U& B) N" o$ }我的问题是,在每个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 W/ Y* d: y8 \4 y: F2 d
! F6 }" V2 O- w' K' B8 M) c& Y
begin P_read arriving
1 f" \4 `: n* Y+ R2 S    while 1=1 do begin
7 A. P& @$ S: P. ]6 a0 e2 ~        read A_tote from "data.txt" with delimiter "\n"
0 s6 b! b% @! y  n5 v& M- O        read A_time from "data.txt" with delimiter "\n"
4 L0 u1 M( s5 F1 N, q        read A_leave from "data.txt" with delimiter "\n"# R; T2 C3 s' C! Y
        read A_picks from "data.txt" with delimiter "\n"
0 o5 O$ `( R! g! F. r        set load type to A_tote
' ]4 S7 w7 N- W( Q+ b; r        if A_tote="tote 1" then set A_induct to 1
: `4 r. a& {; O9 q        else if A_tote="tote 2" then set A_induct to 2
- s$ }5 p) b( @6 O7 P0 w  ^            else set A_induct to 3    , E/ I% S# F8 u! q* w5 b
        set A_i to 0! ?) P. j, X. @* A5 ~
        clone 1 load to P_induction
) C6 s3 M; F; k/ y) x        wait for A_time sec
: B( N; L4 s0 }( v) q$ g    end0 I6 w$ {( B6 t
end
- C) j: p. e+ D" \  H2 k1 y; M' H, D9 c8 u! {
begin P_induction arriving* O* `& s3 T; a- X; Q+ [4 |
    if A_induct=1 then clone 1 load to P_pick1, t" _1 P0 Q3 b! w7 U
    else if A_induct=2 then clone 1 load to P_pick24 R/ b3 E6 ]5 `. z& K; @
        else clone 1 load to P_pick3
! E7 I/ Y. Y- e) R$ M8 Eend
6 x* M* z+ f2 w) e; r9 e+ A% q, z4 c- v1 ^3 O: i# I6 f7 p
begin P_pick1 arriving" Q0 o' F/ B! L3 p
    set A_i to 17 Q4 \, w) ~: y6 N- @
    move into Q_induct1
4 w: F' i& B7 w- t- p    move into pickaisle.induct1( ^8 k9 }1 u! z; I  y/ V2 r8 G% T) e
    while A_i<=30 do begin5 w# M2 a4 v) U5 ~' w2 Q: |
        travel to pickaisle.con(A_i)8 w3 G/ H) u/ c3 z# {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 r& U) o: P5 Q7 L9 _! E        else wait for 10 sec
- P' |0 w9 W! Z8 Y* d$ b        if A_i=A_leave then send to die/ K1 o- @8 i" n( L" p: n& `
        else inc A_i by 1/ f9 Z$ {* \) T" q( k0 ?& n8 j
    end; r8 Q: t7 @" R
end
0 R. D: w  y- A" |  ]3 T  n& ?0 H! Z; U
begin P_pick2 arriving
& R! a) I* ?# n7 k. G# ]    set A_i to 11
8 R6 b6 X, n3 J( m* }' G( C    move into Q_induct2
' l- O& M) Z7 j; q; H% c    move into pickaisle.induct2
8 `+ ~. ?' P; h# Q9 ~    while A_i<=30 do begin) N0 v% J# U" X3 B4 R% l
        travel to pickaisle.con(A_i)
- o' K! A& G8 M, s% Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) M5 W/ |! g; G- e3 m. R$ ]        else wait for 10 sec" u" ]. x* [. Q' Q% k$ W
        if A_i=A_leave then send to die. ~! m4 W. e  ]# c
        else inc A_i by 1+ `, j9 L  Q/ j8 d+ e
    end
* v# E8 X# i& D" q. N$ uend
% _6 i/ h2 z* ]6 {5 W$ O
3 K$ z* t* r* [4 Q$ a3 K$ Ybegin P_pick3 arriving) D2 V1 e9 V3 G" z6 L& d( @
    set A_i to 21
& j$ j" q8 {7 K" F    move into Q_induct3
. l; X  o8 w$ S' y5 A3 I% x: J. i    move into pickaisle.induct3$ p9 A) r+ C0 o+ X. r5 E
    while A_i<=30 do begin3 ~! d: m7 A2 @7 p  _& Y% ~
        travel to pickaisle.con(A_i)2 C2 K( J5 V+ A- I) D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 \6 \' D  \! ]8 N: L7 p2 f% K7 Q
        else wait for 10 sec
+ o# \" a1 \  i" S        if A_i=A_leave then send to die
7 c" J/ M; u7 u0 G3 m/ _( W        else inc A_i by 1/ Z5 z1 y' M! d* t+ k' {) w) l
    end3 |( T+ m- `5 E; V, y8 h$ W
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是个什么东东?
. L* [0 ]& C; O8 ?5 _6 ?3 Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 C( m+ d! c! i* _) X2 x; y+ z% @; Q+ O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ |1 Q0 t5 O3 h: P$ q4 X! w1 G3 \+ k0 o4 \8 g" @
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 m* c9 {) P  K$ ]9 w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! A8 l# J+ `+ E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 E# }3 h  {& r# A0 A$ _7 Y/ b" X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ }3 w1 x8 X! Y0 g- c) l+ X
begin P_induction arriving
. Z# h+ i# h7 M3 k5 g. [) `    clone 1 load to P_pick(A_induct)# o% m, Z5 f8 p& I
end最大的系
/ |5 I" i5 U. e+ z8 w' a/ l
2 }) q* f* Q) I( S$ r2 ]+ b5 x+ |" C2 ebegin P_pick arriving! ~% G7 R0 I( S8 U+ K8 f6 Z7 [
    set A_i to procindex * 10 + 1- E6 l" \3 D; k8 o+ W4 b
    move into Q_induct(procindex)/ g4 U7 v0 k; X# c% ^) C
    move into pickaisle.induct(procindex)/ x, ^% l' H/ O; i
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 a0 I9 t8 P  p6 E3 j' g3 [: v$ _/ o- p! j: m8 p" }4 w+ Z" O7 \
    while A_i<=30 do begin
) a. F/ W% ^7 k5 d- i/ \        travel to pickaisle.con(A_i)( X* \7 |$ d% N- t' `7 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ Z  j# m( r8 ^7 s; q" w
        else wait for 10 sec, f/ D1 `% L) M- G
        if A_i=A_leave then send to die
2 w) P+ n" p$ l3 Q4 V- S3 \7 F7 M        else inc A_i by 1' t" |( N: n/ }6 g; A+ W
    end% k. J+ ?, a% q0 ^. j
end
; o) D" y6 d0 H$ H, c+ \, x% }9 @1 ?% {& w( Q: z
其中的procindex为整形,代表当前process的序号。' X* ?9 Q2 E! R  I) T
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-12 21:24 , Processed in 0.015627 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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