设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13118|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- T3 K" \: h" n& H2 ]( ^! z7 [) y; e) f. @0 R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 B4 G0 k; u! z9 t) t1 q
" r' D) e' |! ^begin P_read arriving& W$ i) x8 e( y2 I* q6 {& a! H
    while 1=1 do begin
" A* R1 f! [; ], Q) c1 f        read A_tote from "data.txt" with delimiter "\n"
' _. D4 R5 H9 ]( y8 x) a6 T  @. R  z        read A_time from "data.txt" with delimiter "\n": Y- h2 J9 @; X
        read A_leave from "data.txt" with delimiter "\n"; W8 d. |4 M0 x
        read A_picks from "data.txt" with delimiter "\n") m. w+ O( [- L
        set load type to A_tote! e0 Z0 n  s+ F+ O; {& L: y7 A9 D' f
        if A_tote="tote 1" then set A_induct to 1* e# l9 v3 O* E  X9 M) f
        else if A_tote="tote 2" then set A_induct to 2' [+ L" [' y0 ^5 ~- D  ~- \8 w
            else set A_induct to 3      v2 {# V9 Q% n$ \7 }. E, m) Z/ a
        set A_i to 0; ?2 S- e! G- r. r0 E+ F
        clone 1 load to P_induction! w" i5 ]; v% ~1 [1 j' j. L* E
        wait for A_time sec) E5 Z2 i2 u8 D
    end; G  s5 o2 d$ o" W7 y8 R
end
7 k  c0 e/ m" m: w8 ]1 {" P
: p1 c; W2 M! t6 D" rbegin P_induction arriving& x: F2 M3 ~" T- S9 m' H0 R8 l
    if A_induct=1 then clone 1 load to P_pick1
8 s6 v' `' I2 X$ p' H    else if A_induct=2 then clone 1 load to P_pick2
* g- K# t  J" s5 t        else clone 1 load to P_pick3
, c; c2 t' k" v. \4 n$ j9 ?end
5 V+ k0 n" ]# L7 V) f
& s$ ?. ~4 C* F) a6 {* Dbegin P_pick1 arriving3 C& ^  r5 S. L. i5 t/ y( z
    set A_i to 1
# |( E4 A" m% v( r! Z/ v. l    move into Q_induct1( u# o/ H! j( o. x/ i4 O1 J
    move into pickaisle.induct1
' e  g5 |0 |5 `/ j3 H$ t5 C3 y# g4 B    while A_i<=30 do begin  u+ x& K1 L6 V( v) |2 G
        travel to pickaisle.con(A_i)
6 L  U$ u1 p( @8 W# q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# o# P3 b) D% r; N2 y        else wait for 10 sec
* [+ [; t1 S9 v        if A_i=A_leave then send to die
( o0 ]% G5 N+ `2 m  G7 d        else inc A_i by 1
5 a6 ~7 _$ O/ i+ T0 y; a' A3 Z    end! Q5 G$ I8 [6 W5 C  j, V, f' g9 I5 v
end- T/ A6 f2 `9 z
3 ]7 a! U- G0 Z- p  g
begin P_pick2 arriving
. n3 H5 a8 U/ ?3 f/ H    set A_i to 119 n/ K! P* @1 o7 l6 r
    move into Q_induct2
, h/ @( R  a" N3 B* K, b) t    move into pickaisle.induct2( ~3 ], `' _$ P) P
    while A_i<=30 do begin
* Y% b1 m8 _! Q1 B4 e8 Q        travel to pickaisle.con(A_i)6 c- Q6 o4 p0 }* s9 S# U% _5 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- x- r) s" A& x$ F+ l        else wait for 10 sec
, f, [+ }4 h; E$ Q* P, a        if A_i=A_leave then send to die9 G. x% q4 y' ^* v  d+ R
        else inc A_i by 1
% W+ K. y% R4 q1 X, ^    end. s) g) G. b! o8 z' A
end
) W  S! C' |0 C; w3 g" i4 b+ m2 J7 T7 \6 a; N( z
begin P_pick3 arriving7 m, R; A; c1 |4 p4 ?1 w7 u
    set A_i to 21
2 I* H# ]! t2 D* W8 t+ T  Z    move into Q_induct3, {) b7 _$ D; K( M' V* m
    move into pickaisle.induct3
* x6 |, \5 t2 [2 t    while A_i<=30 do begin
* L% _+ z$ L6 d2 w" O( I        travel to pickaisle.con(A_i)
" a7 b$ z& S# D3 ~$ ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 v% [. c, \/ ~4 O/ Y; v        else wait for 10 sec, V( N5 r( d+ T& }4 I
        if A_i=A_leave then send to die4 _1 z* p8 x) K6 R1 ~5 Q
        else inc A_i by 1. E* U. A& m  o  n$ L' R/ O4 n
    end
9 f! g2 [5 `; c. Send

最佳答案

查看完整内容

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是个什么东东?; ^2 _; f" G) b$ f2 o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ [" P2 N% M) o/ D$ c. r
- }9 M( v4 s4 e; u! R' ^+ a$ m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 f3 @- U  i7 }& S/ I6 q! q% c  U* o, I# ^8 h% J; @; P5 C
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 ^$ b" J/ r' j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ u* R5 E9 K) A( Q- x" u, h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! q( a$ I0 i" f! @- b5 i2 w0 F4 h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( F3 ~( Y/ p9 E) {
begin P_induction arriving, A4 ?4 K0 U$ B/ b, `2 b9 ?+ Q  h+ s6 x
    clone 1 load to P_pick(A_induct): ~8 r5 n9 _. h) m( k3 L6 Y# |4 e
end最大的系
  I3 l* v6 p- G5 G  T% L9 G* W: ?. ^  ^# p; g
begin P_pick arriving$ c% C- p0 O: C% H) H4 R+ n" M. k
    set A_i to procindex * 10 + 1% a, e9 O/ z* ^& c
    move into Q_induct(procindex)
8 P% d( n& I& A+ H    move into pickaisle.induct(procindex)
/ c/ A. b' s* u    /*check the type of pickaisle.induct(i), for your last problem.*/0 b2 R8 \4 Z# ^0 Z: R1 }: a1 K

0 o" {$ u% q: q    while A_i<=30 do begin* |$ Z: ?% }0 O( i6 A
        travel to pickaisle.con(A_i)6 @+ j0 l; Z: H) ?# B# A7 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' w$ ]0 u' N0 h% J' W* g
        else wait for 10 sec/ p0 ~4 ^$ [, H) @' `8 A
        if A_i=A_leave then send to die
9 _: p- S: T% Y5 Q& ]8 e+ D        else inc A_i by 1
7 c+ @1 @9 P9 g# J) B8 H8 ?    end: K# e0 O8 q: y
end; p. R2 }: h  F  j7 i; u
! T- M1 Q3 x0 ~2 |' Z! T
其中的procindex为整形,代表当前process的序号。+ m- p6 S7 P0 F' s3 O
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-3-20 00:07 , Processed in 0.013651 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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