设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13096|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ U: T- ]( Q) X2 ^. e8 ?
  ~% o/ C" Y) T4 y( c3 `6 v
我的问题是,在每个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" K, l; M1 t6 H/ @; C
- F8 w) n$ G( e# j
begin P_read arriving
( B% H7 j9 N) j9 m8 h    while 1=1 do begin0 ]6 ?1 `& m  B  e4 G2 I
        read A_tote from "data.txt" with delimiter "\n"
7 t  o4 ~5 Y$ }% I        read A_time from "data.txt" with delimiter "\n"
/ ?' L+ t4 M7 `- ?$ e7 y  Z        read A_leave from "data.txt" with delimiter "\n"
' E$ y1 v0 f4 x9 `+ D% I# `        read A_picks from "data.txt" with delimiter "\n"6 D% Y) d/ H( h+ i3 U" Y  T
        set load type to A_tote
* b+ S$ [& K4 `2 p1 t: A, d3 U        if A_tote="tote 1" then set A_induct to 1
- v1 g! {6 H  g" v/ S  Y3 U        else if A_tote="tote 2" then set A_induct to 2- v9 @0 k4 i; q4 l4 i% A6 u* n
            else set A_induct to 3   
, y: l! E" D. n+ j0 g8 q' C# e6 C9 {        set A_i to 0" b9 D% y& M  G9 B3 V  T/ o0 _1 P
        clone 1 load to P_induction
1 b; Z* N; \, t9 \; h' E6 V        wait for A_time sec
, k0 m9 ]; z9 s" Z8 F/ j    end7 Z& ^- i8 t3 i4 M' Z
end
" x( N/ T2 M' j6 X4 B+ t6 \1 X! d) F$ `: H
begin P_induction arriving2 P# ]0 S& [6 F, z) t
    if A_induct=1 then clone 1 load to P_pick1
) i3 o" U7 q( z0 O    else if A_induct=2 then clone 1 load to P_pick2! V# D( E* S: z8 H/ B. o4 x: E8 y" j
        else clone 1 load to P_pick3
* f4 Z/ N& E2 \( v" Aend1 \% \4 Y$ w3 o/ S6 F
# h2 p, C# Z6 A6 F! V; P% _7 q. Z
begin P_pick1 arriving: v) D! _0 x0 G* q
    set A_i to 1
7 B) F8 q, M/ P1 p4 a7 a    move into Q_induct1* U8 y1 C7 ^9 ^  J: h
    move into pickaisle.induct1
1 }3 @3 n3 m& Q. S    while A_i<=30 do begin- p: S4 W4 q/ A3 L3 F$ |( Y( R
        travel to pickaisle.con(A_i)
, v9 O: V; t, O9 x) B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 D! m) Z$ M6 v/ |( ^9 z+ m        else wait for 10 sec
' z1 s& S/ _  m        if A_i=A_leave then send to die
- A8 \6 y4 K5 W+ o: }6 Y) }        else inc A_i by 1
* e6 W" C7 H, q( i$ _8 x. `    end
; U/ C5 f1 E8 r/ L% c5 K1 \end
0 y( U7 S1 Z! W
! p" v( I  y1 ~- |* m9 Xbegin P_pick2 arriving1 h. |/ W3 v6 w% M1 Y9 \
    set A_i to 113 g( P2 J. u8 p" p: _9 u
    move into Q_induct2- }$ E1 U* a, C/ `$ v6 V) |
    move into pickaisle.induct2
5 R/ N; a2 U# i0 n% D7 p+ d    while A_i<=30 do begin0 n; T9 _6 [/ E8 f% b  J
        travel to pickaisle.con(A_i)
4 T- J! ]" k" j" A* Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& A' x7 y( A$ ]4 }; {: n
        else wait for 10 sec
! E+ k8 ]0 @) o% `5 q# w        if A_i=A_leave then send to die6 R8 }9 t, \2 ^# L- c. {( e
        else inc A_i by 1/ Y, n4 A% C4 g
    end
2 r" l8 ?% V6 \end
- n/ v3 g: {1 n  I0 c# `7 m
" }* i! G/ [( u8 }& o* Nbegin P_pick3 arriving  w5 j" m' F: C8 E
    set A_i to 21
+ C6 \8 H) ~1 q  w    move into Q_induct3, _" U; z; V0 g) L* a4 @
    move into pickaisle.induct33 V) N( `0 i9 i. G( ~; a
    while A_i<=30 do begin1 a9 g# F5 }3 ]& x5 V
        travel to pickaisle.con(A_i)9 @2 W) H5 E0 X. Y! ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 b5 w) D; W3 }0 s: N  @        else wait for 10 sec4 m* Z6 H7 @3 ^% _" i4 ^/ j
        if A_i=A_leave then send to die" M; t* O& e+ g7 `" L: S
        else inc A_i by 16 S& ]' M$ `4 q. p7 V7 A
    end
8 f3 l5 t) B/ b# |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是个什么东东?
' I! ^4 y: R. r$ o8 H4 Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( L$ u3 M4 J  @5 a. P$ U% U

/ {3 R+ z$ O' _  p( X! YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: H4 s. U' B: `4 ^

, ^' p4 h- a# I9 G另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 w! N4 I) J4 j% t8 K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 L2 j' _7 {% O/ u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ i6 S5 ]" J' n% ]. i6 a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( y. r9 p% ]% q8 j/ P# `7 Sbegin P_induction arriving
2 z# f" E0 h' b    clone 1 load to P_pick(A_induct)7 V* K* ]$ J7 y+ U
end最大的系$ _# I4 b5 q0 O! s. O8 x

2 X6 N4 C- x% s% d2 sbegin P_pick arriving
8 b8 ?7 u& y* }* F$ @6 u" G' n    set A_i to procindex * 10 + 1
0 N* O$ Z' b6 v- E2 v    move into Q_induct(procindex)
1 C6 H: G) ?% j# k0 s9 Q    move into pickaisle.induct(procindex): ?8 [4 o( m. o* H
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ v' C) E9 V' c
9 C7 N; T" Y) s" N3 E7 X# j; G    while A_i<=30 do begin
" z; u  j( ~+ h8 f! k        travel to pickaisle.con(A_i)
" _, A, V# v- E0 V' d0 m$ H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 N( H% ]8 J+ c4 D: {" \2 {        else wait for 10 sec% T* W! a! {. e% K
        if A_i=A_leave then send to die
1 F3 f" W( m3 v1 p2 @) B        else inc A_i by 1) r( B1 z6 y8 Y
    end# k0 j0 t+ `- {/ |3 h; q
end
* Z, J7 I3 Z, [" M, v" M# k4 M
0 G' B$ p( J& t+ H9 N其中的procindex为整形,代表当前process的序号。
2 [" Z& r8 r! Hstation和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-3-18 06:12 , Processed in 0.015658 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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