设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14128|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 }! F, e1 O! S8 K# H1 k5 o# T/ W% V/ E3 z- N. K, j& l! 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中的数值,不知道会不会有什么不妥。
$ M' C" g- B; e' A6 r- a' b8 n  Q* `/ f1 T" u5 R) }  l
begin P_read arriving. w& o( I3 N; C
    while 1=1 do begin
, W0 f& W$ A; `9 r) H7 `+ }8 V        read A_tote from "data.txt" with delimiter "\n"
* G. e) w+ W6 v( ~, @- Q        read A_time from "data.txt" with delimiter "\n") c( \& G  M8 m/ }  ?7 ~9 x
        read A_leave from "data.txt" with delimiter "\n"
' \  h. I6 L, R! w- K        read A_picks from "data.txt" with delimiter "\n"2 R4 H5 A* h3 V* W$ I- h' V! n: J
        set load type to A_tote
& a( n8 `. }- J7 R        if A_tote="tote 1" then set A_induct to 17 t2 J  e$ T2 d8 |6 X2 V
        else if A_tote="tote 2" then set A_induct to 2
6 O: p) l/ A$ A: ~+ ~            else set A_induct to 3    2 T; f! m1 A5 S+ o& q1 x
        set A_i to 0
8 c9 o2 B( c* u4 I/ F6 C. X        clone 1 load to P_induction7 f$ a4 R7 Q' k, L
        wait for A_time sec
" I3 W7 B3 u; Z. F- i    end4 b7 E7 ]0 z" J4 {8 }" C
end: K- Q6 e( U' h+ I* V9 H, c

0 Q, ^* a# A7 _8 V2 a' `0 zbegin P_induction arriving
! [) C3 K, b4 O9 `/ [    if A_induct=1 then clone 1 load to P_pick1) B, c2 X5 k# x6 T! J# `5 _
    else if A_induct=2 then clone 1 load to P_pick2& |& m& ]6 b: `6 `( p
        else clone 1 load to P_pick3; a& |4 D, L; }1 r  \" \3 v
end" g" g; J  e+ m- M5 P; \* ?

  M; \5 o6 Q. K" h- a% bbegin P_pick1 arriving  J4 `# b4 p5 B% @, g5 o1 o
    set A_i to 1
( G  D& K' E) L8 R* R! p    move into Q_induct1  F2 C1 n4 A; C3 n0 Q3 U) s
    move into pickaisle.induct16 K, w0 c: |, ]
    while A_i<=30 do begin! `7 i" ~: r- u' s4 E
        travel to pickaisle.con(A_i). B& R9 ]$ s& i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 m- I* ^6 o8 A) K# h, r
        else wait for 10 sec% S; J4 C9 |# F$ x4 ]
        if A_i=A_leave then send to die
. f7 ?  Y# _2 k8 x$ X  O6 U        else inc A_i by 1
' Y* k& q; ~0 ~  J: x    end
, _, C# u" z' @" z# i2 `  X. f. yend7 J5 M/ Q! L/ m. ^$ o

4 ^, f! g* D/ N% p0 j4 i9 Qbegin P_pick2 arriving
: H8 ~4 L$ N& T$ M    set A_i to 11
; C+ H/ j5 Z# k: Y# i" E. N. \    move into Q_induct25 }; _7 H' y2 U9 s
    move into pickaisle.induct2/ ~- \% n* H* k6 ]% P3 h* V* ^
    while A_i<=30 do begin
* l, K+ Y2 a4 j9 W$ |$ I        travel to pickaisle.con(A_i)
: a- d' v. ?  e$ s6 X! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  k$ B8 Z8 ?, u6 @" J& K        else wait for 10 sec
5 g" a2 ?( W8 ^; k, ]: I9 e3 T" q        if A_i=A_leave then send to die( [) B4 k/ \+ N7 d" |. @
        else inc A_i by 1, I7 l3 l+ C, I; ]
    end  `5 n8 `) `: Z' O3 T' C; l
end" f5 ?1 L- A  L5 ~3 D
; Z# t+ w4 b8 x; U: Z5 U9 t  t. ^
begin P_pick3 arriving$ Z8 L2 N7 V* k, D+ B
    set A_i to 211 G0 M, e- Y/ p& w8 T4 w
    move into Q_induct37 H4 u! z* q! N6 l9 J9 I) ]. H, ?# K
    move into pickaisle.induct3
5 B* i9 e) }# V* Q. j9 |    while A_i<=30 do begin- H+ n2 S5 @! ?! B' _$ q  ?3 t8 S/ G" i
        travel to pickaisle.con(A_i)
8 x0 f) Q3 {6 I" U& w8 o4 n8 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& }9 W- v" o/ A* C. \        else wait for 10 sec/ s' B% x0 m% L, k  ~. T$ T
        if A_i=A_leave then send to die
6 V6 ?2 T6 t5 P% x- y+ b4 t& c        else inc A_i by 1
0 G, t  E. ?, U. F% r. L    end
5 T, {% y+ P; C# {! [5 o+ Iend

最佳答案

查看完整内容

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 g" Q6 i% F3 j: r' @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 G9 s, w+ n0 H3 ]
! G# E1 Z2 j3 Z- I$ l2 ^
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 O0 f* E$ D. ~$ n. S& S3 V- Z" g

8 Q+ `7 N4 I- g6 G, ^! k. ?6 o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- s/ O/ e6 Z3 n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 ~! J1 [5 U5 @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 p8 B+ |( ]5 T# D. q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& |, H8 Z! e# Q1 ?/ ^/ ~begin P_induction arriving: {% S2 J3 p4 q) \
    clone 1 load to P_pick(A_induct)* T' z- ~5 e1 @0 F8 }/ |  S) T' Q: v
end最大的系2 h7 G5 I& J2 x7 g  B

' s; r6 F) ?5 s) Fbegin P_pick arriving) H, i5 H8 i# l5 X' f6 o1 }
    set A_i to procindex * 10 + 1* X% Q4 I2 V# j. \
    move into Q_induct(procindex)5 q) e1 _& ?+ g
    move into pickaisle.induct(procindex)
- X/ ?# C. K/ V  ]6 t    /*check the type of pickaisle.induct(i), for your last problem.*/
. m% J7 d$ w- Y2 r4 r, W0 r% X
+ J* L  N" Z, S, U% v: E    while A_i<=30 do begin
6 Q6 S6 x% S% o7 t2 |" ^# ?% c$ Z        travel to pickaisle.con(A_i)
9 {7 g( @( h# l# K4 q/ w6 U4 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' l. N5 l/ y9 t( C) V3 o' \8 B; _- A        else wait for 10 sec
. U; Z6 u! Q; R! B# }; X& E        if A_i=A_leave then send to die: a+ H6 F# Y) F$ |" \# y
        else inc A_i by 1
, Y# R0 H4 k( n+ K* u& m    end
9 \! u( e6 g% M$ a. m+ O4 k6 zend6 P; J, w! a, l" A* h% m6 j! W

7 }' m: A/ R6 E* x& q其中的procindex为整形,代表当前process的序号。' y/ m  Z# \. \* A$ d
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-6-11 23:29 , Processed in 0.016153 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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