设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14273|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 B  Q0 Y" x( q! H, P, L: u7 Z# t3 _7 |, }/ A6 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" N4 a6 k. l) ~

3 D9 V/ e( \! T( Z0 Zbegin P_read arriving
% O. a+ _; S& F) o. G    while 1=1 do begin
# |" M7 d6 }2 e6 [& v7 m( g        read A_tote from "data.txt" with delimiter "\n"
5 @; h/ \% f/ M! D5 N2 d& j  n$ I        read A_time from "data.txt" with delimiter "\n"
) ^! K* I/ R% s/ \        read A_leave from "data.txt" with delimiter "\n"
) |' S. z4 s+ ]; a; R        read A_picks from "data.txt" with delimiter "\n"
/ Y3 h2 x* s7 a0 p- ~        set load type to A_tote- w$ W  W8 _; q9 E& h8 {
        if A_tote="tote 1" then set A_induct to 1
' o$ o# _; K: Q- ?        else if A_tote="tote 2" then set A_induct to 2
; ]6 R' l/ w- K: Z7 |- O% W            else set A_induct to 3    9 v- U6 y/ h2 W$ B5 h
        set A_i to 0
% p9 w0 c% g& r# x( {+ b* ^        clone 1 load to P_induction2 ^; o4 e! A6 g$ ?
        wait for A_time sec
. H. k. F2 W# ]7 n/ F8 d    end
0 y. I; \5 s7 p9 A/ S: ?end' d; y( X+ Y) S

4 I7 ]9 S7 o8 u& @, k( e* rbegin P_induction arriving7 Y* h: ]7 D8 P1 I
    if A_induct=1 then clone 1 load to P_pick1
% V( U0 l! @8 _& T, l  U/ ^3 s    else if A_induct=2 then clone 1 load to P_pick2  N( M# Q' Z2 V$ o' |
        else clone 1 load to P_pick3
+ i9 l. r. Y. P% D5 }  p& `end
, U) m1 b" t: P8 U# i" i! b! s
0 D% T4 E" `% X# Abegin P_pick1 arriving' w" w0 |4 U7 F% y9 D3 q, \
    set A_i to 1& R* X/ A: M9 z: L+ c: n
    move into Q_induct1
2 S4 f3 Y, P* P- j+ Q/ A" n4 B    move into pickaisle.induct19 E! W8 |7 V" {) N# a
    while A_i<=30 do begin
1 F0 ~1 e* }  X& [: ^; _0 b        travel to pickaisle.con(A_i)5 {- x2 m6 C+ I  j% h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) I1 r! w% K  j) M& V, I
        else wait for 10 sec( i+ a# L( K  K( ]4 W
        if A_i=A_leave then send to die
; P- \8 c8 `4 K' X        else inc A_i by 1
5 J  T" F$ n! e7 S( ?    end+ A$ i2 e( Y% j
end
8 D: Y( t  H/ q( Z0 K) B" L
6 Y4 Z1 J% r) K8 k8 d- mbegin P_pick2 arriving
, k9 C0 X/ R8 G, e    set A_i to 11
: K) z& f. e! u! P* C    move into Q_induct28 R  X! V! o- `! w  t( \: ^
    move into pickaisle.induct2
/ P" F! ]9 @' k+ \6 o    while A_i<=30 do begin$ x& ^. }- ^& ], E7 `
        travel to pickaisle.con(A_i)
2 I9 b/ H, k# z6 a0 F% W) A1 |  y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* P  R# C0 y3 K' y% r        else wait for 10 sec
9 V  n, E2 `5 ^# q) h; P        if A_i=A_leave then send to die
; H6 T7 Z: N) F& {' j7 d        else inc A_i by 1
- q$ L2 l+ t) C- y6 m- j    end6 j# Q! q; K6 V& ~+ W; I: j
end  u% r. U8 ?- _) s1 [

& k  X  h1 x! \7 {( O6 m! W) B! pbegin P_pick3 arriving( v3 A1 m0 z9 G, v
    set A_i to 21
* U* Z( i( ]$ \# o! Y6 o    move into Q_induct3
( T' a9 y0 S8 z0 [" O$ o9 G  s' q7 b    move into pickaisle.induct3/ ]) i5 W  E/ F1 {' `; t) C
    while A_i<=30 do begin
: g. G  O, f3 G/ N" |0 K# P        travel to pickaisle.con(A_i)/ Y0 A3 y* }  p3 r7 D& t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- `; r- L, \$ \7 p& V0 P9 O- x        else wait for 10 sec: ^6 g/ q+ S+ e, x6 B$ ]& b. V4 h
        if A_i=A_leave then send to die
' N5 a# H% ]& K3 o6 W        else inc A_i by 1
. j& }3 f; g: q; Y2 {* i8 C/ g    end7 r4 w: P) D! z  m, s$ B  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是个什么东东?3 L3 t4 q9 \- X5 F2 L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ u) ?0 l  A5 h8 l* b2 w. D! z
) F# b( {) N/ l2 K( d# Y$ T: EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% @4 |$ b; X4 u0 g! y& B7 Z- J. N0 U) G8 l8 f5 s# J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. @) g/ r5 l4 A5 T3 m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% O% s/ \& t7 K* T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: l% }* |5 ~5 \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) p* @2 i7 h' Qbegin P_induction arriving
) ^! H7 Y  c# ^  N    clone 1 load to P_pick(A_induct)
# {8 E. r0 W" t/ N7 gend最大的系+ q1 u5 y- ~4 x% U* t) K; b
( R5 @% ^% G. c. m3 o0 x; x6 g
begin P_pick arriving
3 A. N0 _7 M4 [, X    set A_i to procindex * 10 + 1
: x( J0 N+ R% F$ b' U    move into Q_induct(procindex)" u5 @1 Q; K; o- T9 W
    move into pickaisle.induct(procindex)
# N$ V$ b  A! ^% ~; u) ~, |' }    /*check the type of pickaisle.induct(i), for your last problem.*// Z! b6 E9 @5 `& l3 ?& ~& \- U

8 b8 L9 l' \2 p. Q; H( \4 X    while A_i<=30 do begin
4 W& b) v# a3 P: m6 w4 U        travel to pickaisle.con(A_i)! p  h# y/ T  n2 \& ~6 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [4 B6 d3 z- y3 d: A( y6 E' C2 ]
        else wait for 10 sec
' M/ o! w* ?! @/ o" t% L9 r, w        if A_i=A_leave then send to die
7 J$ f# Z2 u7 s0 c" _        else inc A_i by 1+ A0 Q) K  Q: n( k5 L4 p! H5 R
    end
0 E; P& @( T. w( Z6 L7 l8 @end5 ^7 `9 J5 c  B2 y
; _. }5 C& \- y1 d- `4 A% ^
其中的procindex为整形,代表当前process的序号。
8 }$ l  ?' S2 O8 A9 lstation和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-26 20:09 , Processed in 0.018691 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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