设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13813|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ _) d) i% d$ ^7 o: i$ ]
2 d7 W) h3 n! L: K+ y) U* N0 I/ C我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: B' f0 E$ S4 q# E' R* w4 d( i, J+ o
. x+ q, G- k3 i  D2 R& w& @7 xbegin P_read arriving5 e) L" S8 l0 S/ U3 R' M
    while 1=1 do begin
& d5 x/ U. s0 ~1 h" C2 j8 G3 J        read A_tote from "data.txt" with delimiter "\n"
1 E: J1 I' K# b8 Z        read A_time from "data.txt" with delimiter "\n"
* c3 q8 j& j8 ]' e6 D        read A_leave from "data.txt" with delimiter "\n"4 @! n" O1 \& E" p1 p' j
        read A_picks from "data.txt" with delimiter "\n". \' u0 V/ r% L$ b% ?' P: \$ w3 O
        set load type to A_tote
, O. ]- }# d* ?& S8 P4 n- L+ [        if A_tote="tote 1" then set A_induct to 1  ~) J/ I  z0 L0 M/ ]( X6 V
        else if A_tote="tote 2" then set A_induct to 2( w+ f( [; s$ o; F$ [( n
            else set A_induct to 3    0 I% k- w- ~  Z$ ~) o, n9 C  k5 [
        set A_i to 0; T; {# }0 u" x+ D! B
        clone 1 load to P_induction
) @. H. o/ Y9 X2 [- m+ N, K, L        wait for A_time sec' T8 I, I$ s2 Q' j  x9 G
    end8 U9 |. \% v9 ]2 |6 r/ K
end' w  ?2 c* u: E6 V4 c3 N8 C
$ M" {2 ~  d+ y- a1 q
begin P_induction arriving8 Y$ y: ~( I; }
    if A_induct=1 then clone 1 load to P_pick1% o. @# K2 O# ?$ c7 B0 K: {& F2 P
    else if A_induct=2 then clone 1 load to P_pick2
) p6 s- x$ I: k- w        else clone 1 load to P_pick3
# g) \+ T8 M0 N# m2 t! ?end+ m, w* @- |8 `
" H2 j, ?$ i  n4 V* F( d
begin P_pick1 arriving
* h! o% F6 s5 `7 b    set A_i to 17 _, G8 h% _5 d2 X# B& z7 v. e" C
    move into Q_induct1' ]& g; v& l- h3 ]9 s9 z0 h
    move into pickaisle.induct1
: Z/ e7 Q' A0 y    while A_i<=30 do begin! q) p4 {: M2 x2 o* b: x
        travel to pickaisle.con(A_i). q% L# K9 i( ?' x( s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M6 |/ Q) j6 A  j( d        else wait for 10 sec
- k9 v0 t3 s+ P5 Q5 R. n2 \3 X- g7 e        if A_i=A_leave then send to die% u7 }* p/ b0 X: O9 t/ `! {' S; N0 C
        else inc A_i by 1
8 ]) k, g" p6 B  l. _) V    end
( W* o2 ^* f; X' B' I+ fend2 D6 e. I; F& }( y' l

- J) A: a. }4 S6 e6 \: ~/ I0 }2 Ibegin P_pick2 arriving/ H+ H) S' Y0 w$ }
    set A_i to 11
4 w7 N  q( @6 g# W' u% t3 \; Q    move into Q_induct2
2 Q7 _# H' t/ `+ y    move into pickaisle.induct2' ^  @. j7 L8 |# t
    while A_i<=30 do begin3 {  \- n4 T  p3 Y* U2 F6 s8 M: z
        travel to pickaisle.con(A_i)$ X, y( o9 c; B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& a1 ~7 [+ R) w4 R7 S
        else wait for 10 sec
& }' T9 Y  H( x2 d        if A_i=A_leave then send to die
8 R  w8 Q& s2 C) a0 d        else inc A_i by 1  X4 v/ F) ~, I7 ~# C& q
    end5 h, F- [; z* b5 \
end( [" R- E, L( E9 X( M( r
( ?* D  p2 c( b  W" u4 @* ~
begin P_pick3 arriving
2 T" @3 H% B* @9 s$ _    set A_i to 21
4 w' d% U, j3 D1 S0 t- @    move into Q_induct3% k, b- F: q: i# S! t
    move into pickaisle.induct34 W6 ?( m0 H/ W! g; r8 \/ o- W
    while A_i<=30 do begin, `1 j/ m9 `. Z+ C& a! `
        travel to pickaisle.con(A_i)
! m, N% m* O/ K! s1 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' q  f) C& }  ]  m4 i) P
        else wait for 10 sec" _. q0 W* r5 ]. J
        if A_i=A_leave then send to die
( J0 v. T' S% g& }; n        else inc A_i by 1
" X2 h2 t" [) ?/ C    end- j' P- C1 u5 b8 c) |' I4 q: @, A* X% `
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是个什么东东?
' n1 h1 L# D  Z& J+ ~# Y9 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% J4 Z; b5 L% Z" Y3 ^5 `5 |

& r7 F0 t6 V* i7 aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) e2 d: v4 S, U* _! P# o
7 o/ W5 b" U) x7 T" O/ ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 u% [7 }/ e6 z) l5 G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 S# K1 d0 D  P1 R5 [5 ~( g! u" s4 k: c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 B. R: y6 l- b& h8 p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- K! [, C" _" c! l5 p1 lbegin P_induction arriving
! I4 {; j* ^  }) h    clone 1 load to P_pick(A_induct)
$ ]2 z( r' j! ?8 ^end最大的系' h3 }' a0 a6 v7 t/ M

; K$ z0 r5 P! P. G& J( Obegin P_pick arriving6 d' G, J- c+ @3 e
    set A_i to procindex * 10 + 1
( q* G: \( r! E; }& O1 I! C8 X    move into Q_induct(procindex)
' e: G1 E  I  X; p+ @9 b1 m; A    move into pickaisle.induct(procindex)% E6 G% T8 V7 k: c
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 T8 X3 ?: o% H, |  |, m
$ h& J; k2 F* m/ e  U# H    while A_i<=30 do begin& E7 p1 f# W1 \4 r
        travel to pickaisle.con(A_i)
+ ?9 t8 E7 E+ Y) V- G7 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ n, i4 S  E1 C$ @1 \9 K! m        else wait for 10 sec
8 ], |$ V/ n$ [$ Z        if A_i=A_leave then send to die
8 i+ m. _" v# ]5 l' \        else inc A_i by 19 D4 T8 M3 d' I( Q/ @/ ^6 U
    end4 V: l* W1 ^& T/ \! r! k
end
7 C# K! O9 G5 N0 ?9 l  z& X) n0 w2 l1 ~8 p  r$ `# O
其中的procindex为整形,代表当前process的序号。# u: w  D" ^/ O( y
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-5-7 14:28 , Processed in 0.014144 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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