设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13563|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' {5 c9 y& T' b

4 E* x( {) z7 U) j我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ q/ D0 J! m* }$ O/ U! p" w+ }
) K) T  ^5 T) I; A1 X
begin P_read arriving0 Q1 O; N2 u; z2 z7 V
    while 1=1 do begin
1 y: f* w7 F$ q6 k- @9 I5 Z        read A_tote from "data.txt" with delimiter "\n"+ r3 K& u8 ]6 d: m
        read A_time from "data.txt" with delimiter "\n"
/ H; K' `. g0 N" \5 J        read A_leave from "data.txt" with delimiter "\n"
% @( \0 K1 O' a  U! E        read A_picks from "data.txt" with delimiter "\n"; U7 p% o+ S3 s  E, s( S/ G
        set load type to A_tote1 d( F1 ]4 V  _+ y' \
        if A_tote="tote 1" then set A_induct to 1
! Q- n. v6 @& a3 a) ^/ s# C: m6 Z: x        else if A_tote="tote 2" then set A_induct to 2$ }5 q( h) V' ]3 E: D& i( e. n
            else set A_induct to 3    7 b: F# x! d2 C8 E$ M
        set A_i to 0+ Q6 u  V& }# }5 _1 I: O  W& n! S
        clone 1 load to P_induction
1 k" g, X& z! B& _  p        wait for A_time sec. X7 C- ]; O. L- l. L+ P
    end$ G9 b& v9 N1 B# f. J
end' k+ _6 o8 P2 w

/ P$ G) I- y/ k- T4 K& y& Obegin P_induction arriving
/ S0 g, {* s- m# R, \% t$ z    if A_induct=1 then clone 1 load to P_pick1
5 r7 C# z" M$ D1 g    else if A_induct=2 then clone 1 load to P_pick2
+ B& Z# [' m/ M% r7 B& L, F( ]" E; y        else clone 1 load to P_pick3
$ T6 Z. ]# C; F8 ^; f2 Y- a( ^- Tend  k  y: K; w3 a5 O. e

2 E! S) e! x% C( K# i7 rbegin P_pick1 arriving# i6 R1 Q2 o2 J+ z0 ~0 n, t
    set A_i to 1. Z' B! i" x  N2 `6 p9 T
    move into Q_induct1
8 k3 C# i4 Q/ m* Y    move into pickaisle.induct1
6 m/ j" @3 x3 @  v7 P    while A_i<=30 do begin
9 `+ N" X2 d2 W        travel to pickaisle.con(A_i)7 D; o+ }+ g+ t, N8 l8 h9 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 x* z' o% s$ v" [        else wait for 10 sec
' `  I9 Z9 `; }) s+ `2 {- f2 V4 d        if A_i=A_leave then send to die
" S& ~: X0 F1 g8 O; @' H. U        else inc A_i by 1' k. o7 u# n6 d) s# c* h
    end, Y5 c& [/ r  u8 B: ^, b, M
end
$ X! S$ j% R5 s! [' X8 ^5 N1 \2 |+ \; v& Q4 J, E
begin P_pick2 arriving1 u  a1 S& \* y
    set A_i to 11
* Y3 H# R$ |+ |% J+ m2 [    move into Q_induct2
8 H+ S" _1 z+ c$ D" L    move into pickaisle.induct2
2 a; b% u- ~5 P* ?+ j    while A_i<=30 do begin. h" q' g; V1 [0 |; |
        travel to pickaisle.con(A_i); {8 E* o: e4 z. S3 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 v# m" \8 E& J/ i& ^3 V( P        else wait for 10 sec4 Z+ H' ^; I: h1 r( K1 B6 G9 N" y
        if A_i=A_leave then send to die
7 s* a: a. F3 d; U1 z: M+ }% Y) N        else inc A_i by 1" ~* ^" K# `8 E7 W' y/ ]% X; y
    end
- c' v+ A. G* b3 Zend
  `  X2 P$ O7 U4 e) Q: F2 O: K% A" |7 d+ h5 _0 o0 j& L
begin P_pick3 arriving
0 `4 d/ N% [; m& W) s/ L    set A_i to 21
2 d3 }, L3 L8 h" @- d) V# ?8 m    move into Q_induct3/ z" R6 T$ u0 r0 j8 c0 g. ~
    move into pickaisle.induct36 Y9 o( s1 A4 ~$ a) T: A" ~
    while A_i<=30 do begin
: o% Z7 A8 C! O        travel to pickaisle.con(A_i)0 B9 B& S* t0 i3 f! d# s! F  Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Z' z4 a. d1 c# O- p) L
        else wait for 10 sec
$ T. h+ o8 @. X* y        if A_i=A_leave then send to die) _9 z7 D: f3 N2 P
        else inc A_i by 1; j4 }: D" [+ S: C: P
    end
2 z7 ~4 B/ D! h3 j0 ?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是个什么东东?5 q4 N+ Q) A2 z1 g1 ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ o* k0 k1 R9 K5 c# R7 M
$ @; U; t, O) n5 Q. w, k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. V1 c* c5 I6 i- N) y
$ i0 P! W+ Y1 k$ S( _! _6 B. z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 }4 w# o- w; l! H+ ?4 M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, u$ @" m; A* l$ m7 H8 \+ B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" j' }$ |: a; @7 ~, R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ c3 N+ j+ Q7 x$ x- Z3 Y% ]* gbegin P_induction arriving! K$ {  r3 J% q
    clone 1 load to P_pick(A_induct). B; x' E( {4 ~2 w2 l! g# J: Z  ^
end最大的系, |* i  O: A( Z7 x5 N
' [$ _% s% G) s  L$ x; o
begin P_pick arriving
( Y4 e9 I* ]9 ]: F    set A_i to procindex * 10 + 1) Z- S/ B8 f0 \! v: N
    move into Q_induct(procindex)
0 b. J( f9 P0 z- |    move into pickaisle.induct(procindex)) ]$ @' Y9 s8 L1 l
    /*check the type of pickaisle.induct(i), for your last problem.*/5 A' E5 X/ L4 }( a: X
9 \- I# Q5 r) U0 p9 o. U
    while A_i<=30 do begin  R5 @7 c# X: E9 `0 M6 _# {) c0 G
        travel to pickaisle.con(A_i). S  m# A& O# h& Q& g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 V4 S0 _0 P$ e: [$ S  Z% W
        else wait for 10 sec
- V# }! }: _# T8 z, G        if A_i=A_leave then send to die) E$ w9 b# ^; f* G+ Q* R
        else inc A_i by 1
$ n; m3 P/ u2 {1 w: b8 E    end
4 Y7 E: h0 n( q8 R; send
$ S! E# H' w/ D  M
$ [) w& V9 M: E" g6 y* j! P其中的procindex为整形,代表当前process的序号。$ ]' s# m/ e  w* g, q- a
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-4-21 15:10 , Processed in 0.015740 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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