设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11535|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 |8 r" S- p* Q8 }" L) ~9 v9 [/ L1 Z; z4 z8 j3 Q7 P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% h2 a0 N. Q- w& g% i3 i, S
# ?! U; h! P# k/ e9 T% l( H* Kbegin P_read arriving
0 X+ r, a5 s2 O3 c    while 1=1 do begin: [5 F& @" P# R& x
        read A_tote from "data.txt" with delimiter "\n"& [  P4 I- i) o9 D# K
        read A_time from "data.txt" with delimiter "\n"0 d0 C2 ^$ M( ^& B! Z, r6 z
        read A_leave from "data.txt" with delimiter "\n"
/ }- J" Z3 o; M* M- W! [        read A_picks from "data.txt" with delimiter "\n"
9 X& o, M. S6 r        set load type to A_tote
& |+ K$ U7 I3 j3 J0 h        if A_tote="tote 1" then set A_induct to 1
5 _+ h5 r, ~' b8 ]! m' A9 q; i& x6 u        else if A_tote="tote 2" then set A_induct to 2; M% u8 D- I( M! ?8 W; O5 O
            else set A_induct to 3   
: d6 V/ P( y& ^% ]; k5 \' p        set A_i to 0
* }9 _" q: O: L' P: e/ y- V5 P        clone 1 load to P_induction
2 z) C' i* c( O  {2 s* d; f5 A' \        wait for A_time sec; D5 r3 l% s2 V! [- C3 T
    end
: Y6 ~8 g7 f, Q+ y2 I$ Hend
& ?! i- T3 u( E% H3 A
* T# C# t4 X$ r3 Y8 wbegin P_induction arriving
9 }* V4 \' z  ?  p1 {    if A_induct=1 then clone 1 load to P_pick1/ M/ X2 r1 H) P& c5 l6 j6 C2 l
    else if A_induct=2 then clone 1 load to P_pick2
, ~, Z+ n( |+ g- x2 F% c3 H$ x% Z0 m        else clone 1 load to P_pick34 \4 @: i1 y: S
end& Y' m: y* A7 W7 J
; M; l  [% G) L1 a" x3 F% J9 v, e* p" A0 A
begin P_pick1 arriving4 B# T0 {# s7 |7 f( P1 ]0 c2 R
    set A_i to 1
% d; p' I: _% G- \1 |  c    move into Q_induct16 K% x* d( m2 V; R3 J
    move into pickaisle.induct1- U: z& R! `, W; p/ c
    while A_i<=30 do begin
6 I( O- q: `  |4 o! P        travel to pickaisle.con(A_i)
* H, N6 K( M6 u" O) ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ^. R- l6 c% d, v! s
        else wait for 10 sec1 |9 z+ A+ t9 Y7 Z% b3 T+ h) k1 @
        if A_i=A_leave then send to die
1 ]4 g' W0 q; Y9 U! `3 c) f- \        else inc A_i by 1
( i: R1 K& L. U+ F2 o8 T    end
6 [& L( A1 R( P$ a3 T/ d  F; Wend
8 |6 J# ^( Z7 s* }3 J' ]; D$ e
( b7 Y* I3 S6 `( c5 Sbegin P_pick2 arriving" ~, a- K% Z: y
    set A_i to 112 e* G* s4 ]: {# d; s
    move into Q_induct27 Q- {; D" \& ^: `6 u4 t7 }" q
    move into pickaisle.induct2  b1 K5 M, r8 B; j' d) o. P: I
    while A_i<=30 do begin+ t. j+ E4 g9 e
        travel to pickaisle.con(A_i)
6 ^! Y% d( z% f" g5 w" U4 |1 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 ^  N+ |) j4 q+ }7 O# O' S0 D8 I
        else wait for 10 sec
6 W; j3 H2 m  o$ \- j6 K        if A_i=A_leave then send to die
% E- |# @: z. |( l        else inc A_i by 1
  \* o5 S: y# D0 _  `( f; S, t    end
5 C8 f) Z" {# Send
: W8 p- R0 v- V, o- y7 G$ h- N# c8 Y& D" m
begin P_pick3 arriving
' v4 j7 c  B- A6 Y    set A_i to 213 r1 |% _% G4 d1 _# p2 N, e
    move into Q_induct36 x5 D$ ^& j# O  e9 T9 }9 a
    move into pickaisle.induct3
% U/ \; S: W# |+ r    while A_i<=30 do begin
0 ~6 t5 K) _3 m, C% d) Z  x0 ]7 P$ R        travel to pickaisle.con(A_i)
/ j( Y3 k: p$ a" y, i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* @7 L3 g4 p, ^4 j
        else wait for 10 sec
$ T" k5 c3 m1 I9 q3 Q. J; J        if A_i=A_leave then send to die
0 i& }& @! `8 E+ F3 k0 q1 o        else inc A_i by 11 ^& b* G" a+ z: T: E. l' ~) Z/ `
    end
& u) z$ ?5 [% H. Z! T/ x% Uend

最佳答案

查看完整内容

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是个什么东东?
8 d/ J% h( P( i# S" t4 D2 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 [. j+ I, \  ~( j3 I
0 f5 x1 d8 [& Q( A1 S4 r( p9 t! `! ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 e1 s9 D0 Q- c8 F* @+ k8 Q) U2 I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 K. z. R+ D3 K9 W. G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ c! X2 ~; q3 w* k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 \! C8 J7 g4 t2 d6 A! x0 g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 c1 C0 [8 S; @7 O( ~$ Zbegin P_induction arriving
: Q9 M  s- B3 G! I+ U- X' t1 q0 o    clone 1 load to P_pick(A_induct)
. N, e: E( |2 Vend最大的系
0 Y7 c8 W: B6 J# S+ t$ ?2 y( V6 j/ f9 E1 Y
begin P_pick arriving
$ y3 g5 \2 u: ?# y* e    set A_i to procindex * 10 + 18 T1 Y+ T8 a& e+ ]
    move into Q_induct(procindex)
' j8 F- ^" Y# ~. |    move into pickaisle.induct(procindex)
% F$ K8 s4 T9 _  X7 i' G    /*check the type of pickaisle.induct(i), for your last problem.*/1 w. m: B: U$ h
% X" y  O- q1 D0 M% k1 y! D
    while A_i<=30 do begin
! {; ^/ x  p2 C0 p6 [        travel to pickaisle.con(A_i)0 Y! R4 A1 ?) a, G) s4 e- }0 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. q) @& y( n' p( C& f: o        else wait for 10 sec7 E# ]1 s- C" F4 d. f
        if A_i=A_leave then send to die* P/ n- c& p" t, u/ i' Q1 r
        else inc A_i by 1: h) W; N5 C; a1 h0 ?1 C# k
    end
5 D& h8 O& l/ m7 Tend
7 u. X6 J0 v" ^* c8 i! W( }  U/ j% v9 [, V/ |9 _4 `4 a7 E
其中的procindex为整形,代表当前process的序号。6 p( X- R2 }8 G3 ~5 s6 {2 ]
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-11-18 21:22 , Processed in 0.019124 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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