设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14376|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 U/ n$ r. s. v- g6 T$ h
+ n6 G  Y: A, Y- q1 B3 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( c2 n, {& i: W* l* Q2 w8 z8 ?9 ^9 |
begin P_read arriving
& e! G# n3 O$ V  t% J    while 1=1 do begin
+ V; M, E" I4 d2 H        read A_tote from "data.txt" with delimiter "\n"
* B/ J) l: Q/ I" U        read A_time from "data.txt" with delimiter "\n"
; R" U6 b) s- c5 l; n" m5 `; V        read A_leave from "data.txt" with delimiter "\n"5 K6 U0 V: \+ ?
        read A_picks from "data.txt" with delimiter "\n"
. ^! {( @9 o0 T! m$ E2 E        set load type to A_tote* a6 s8 z7 h. D! Y+ w4 i# o, Y
        if A_tote="tote 1" then set A_induct to 1
" x4 Z- T' N+ z! E6 n: n        else if A_tote="tote 2" then set A_induct to 2. o5 w1 G2 N, n5 l2 |
            else set A_induct to 3    2 m( s7 o$ C& L3 |, x( d* X. _
        set A_i to 01 N' e5 {* {0 J( M. l- Y
        clone 1 load to P_induction
3 G4 e# b- m  D! [+ l8 e        wait for A_time sec
& C$ y" `/ T5 q7 W) v. f8 x    end: {2 s) b1 }2 T  M& I( V, W: D6 x
end* ?/ ?' P. E8 Q% A

$ s1 [4 P3 q4 sbegin P_induction arriving  X8 ~/ A0 V1 b, M( w: M3 [& m
    if A_induct=1 then clone 1 load to P_pick1
* V* F- V- I& G, s% ^$ u' w, O4 L9 W, D    else if A_induct=2 then clone 1 load to P_pick2/ u" G" c. e/ g$ w4 t
        else clone 1 load to P_pick3/ [8 t, g$ `3 V9 F& Y
end
  {/ u+ [. k2 \7 p8 N) K/ C+ s6 k, N8 F* N3 M" k
begin P_pick1 arriving) }. ^" |( Q  e
    set A_i to 1
; B" J8 F& Q/ X    move into Q_induct18 j7 r4 ~5 S- }
    move into pickaisle.induct1
: [# c, [" P+ M5 S" @+ H# T0 V4 i    while A_i<=30 do begin
" e5 ~0 \0 N3 D# D& x4 o        travel to pickaisle.con(A_i)
1 I) i! z, ^* g/ S; {) F5 ^& _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g5 u/ {% D7 c9 i) y        else wait for 10 sec
$ y* R$ N" f% P' Y! W% P        if A_i=A_leave then send to die! P! }6 j; `" l% r
        else inc A_i by 1
: S. R6 k( R! N! _% y& P1 A9 J    end
6 B- x( j$ e- Bend. x; F' x9 \- }, d% v0 c  b8 ]
7 I9 O; ~3 @' j& W7 ]
begin P_pick2 arriving! `1 R- d4 s+ e' o0 H, P+ u
    set A_i to 11
/ l3 R5 P$ @, y3 N) ?. x! r; A    move into Q_induct2
3 i1 E8 u, r2 s2 u8 [0 o* s; L    move into pickaisle.induct20 t* f* q+ I, C
    while A_i<=30 do begin2 f; ?, F9 O& Q: g9 T
        travel to pickaisle.con(A_i)/ L: {! I* H3 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( b' l+ t  ^2 r6 T7 c
        else wait for 10 sec
2 e! p; T; h9 {8 P. q        if A_i=A_leave then send to die
# X1 I. `% _9 v" C# S' `        else inc A_i by 1
, B9 H: o. e' O* F' N6 k    end
* b, B1 F% F  E; T% E3 yend
5 d  L, J5 q7 ]
2 q; j+ m7 [' u& Y; X) t/ ubegin P_pick3 arriving
: `% n+ b4 Z3 U0 x  ?2 r    set A_i to 21
! d: f  {3 b) `    move into Q_induct3
& K1 d$ H6 t- C( j" v    move into pickaisle.induct38 ?$ X2 w# O  J+ p" I, d8 w7 k
    while A_i<=30 do begin0 C# U8 r4 ]6 `8 ~. u
        travel to pickaisle.con(A_i)$ k' ^- g. f  a. n6 e% E- w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% P+ P, W! Q/ ~  \" j        else wait for 10 sec1 u2 f8 _' N* T  f% R
        if A_i=A_leave then send to die
6 C5 c* A" _$ ?) I        else inc A_i by 1
9 b- X" S: k; R: E) G+ h    end% o5 D7 b2 O8 K7 {5 z
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是个什么东东?
! M8 g9 {$ K  bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 X9 C1 B6 c6 X3 u5 r$ d* }& j" d" N

, m' R- _& Z; F5 d/ fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- U3 \: M) @+ Y1 |$ K
* z  o  t" j+ Q# P/ I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 t: u0 t) P8 F7 v8 B: m/ m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. G" c) x9 [4 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& X. W$ u0 x8 j& i6 x4 l3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( C- g1 v; q. Y1 s) [* vbegin P_induction arriving
# |+ M. h8 M7 K# S% R4 V8 n. F    clone 1 load to P_pick(A_induct); H8 A6 F/ R' R  m
end最大的系, ]% S( M: T7 q* o
! D6 n5 N/ ~7 y3 ]) f9 i
begin P_pick arriving& T! Q( v' j' S$ O! `
    set A_i to procindex * 10 + 1$ P' @( Z1 P% ]* V  ^3 R# g' R" N* E
    move into Q_induct(procindex)
1 F* h/ w/ {& |! b0 M* D+ p    move into pickaisle.induct(procindex)0 o* r% s3 p0 b" ~
    /*check the type of pickaisle.induct(i), for your last problem.*/
; I& T* J- u9 d% B; {7 k6 E5 m" ~; f. S3 A1 L9 g
    while A_i<=30 do begin9 Y: ~- a5 J3 h$ ]8 b. w  V! p
        travel to pickaisle.con(A_i); ?. h7 h" }& l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% w& m( O" V5 P! L5 b" ?
        else wait for 10 sec
* g7 i0 P+ B3 X, \) A        if A_i=A_leave then send to die
# X8 O- K- o5 L) r        else inc A_i by 1
$ o4 u0 P! x8 ~/ u    end+ P; ^' h0 R( o4 H
end
$ ], E6 C* q* O. U' f( P' ?7 ]7 O! q3 j7 Z$ g* B1 u
其中的procindex为整形,代表当前process的序号。9 i: r3 a2 v0 x! Q% l
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-8 14:38 , Processed in 0.015324 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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