设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15205|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% e- Y' Z, v* c7 m
1 W* Z3 Q7 F  B; w$ Y& ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 |6 H6 e' F0 w$ |
" Y3 V0 j, J+ a3 p% X% l6 Fbegin P_read arriving
  S$ |. ], {- K3 E' l    while 1=1 do begin4 t  j( h3 t' j5 G* @5 x% C! c
        read A_tote from "data.txt" with delimiter "\n". D/ @  j% ~. W9 o
        read A_time from "data.txt" with delimiter "\n"
# \; B; C3 d. g        read A_leave from "data.txt" with delimiter "\n"& z+ D& p. C' }* q$ K* s
        read A_picks from "data.txt" with delimiter "\n"9 }2 M% G, h2 [1 x$ p3 A
        set load type to A_tote
0 Y- W' I$ e. f  o        if A_tote="tote 1" then set A_induct to 1& e& z1 h. f, h; @
        else if A_tote="tote 2" then set A_induct to 2
, I3 {4 {& P0 Y+ B: A$ `            else set A_induct to 3   
0 {- q5 l0 u1 N- O( E        set A_i to 0
# k* q9 S6 ~3 P) a! \3 }: R1 V7 t        clone 1 load to P_induction
7 M8 M3 n: ?) T) F3 |) X, d        wait for A_time sec. U: R4 R+ n9 z$ {; I5 r/ _/ H
    end
6 V4 S- `: v% Iend
* R& }% j) d) a% D, F2 Q1 H
  |% L; B1 K) D" fbegin P_induction arriving
! X& b: R1 B) L0 _    if A_induct=1 then clone 1 load to P_pick1) S- E, M, t7 F2 Q, {
    else if A_induct=2 then clone 1 load to P_pick2+ e8 P# M: B+ G8 F5 v( ]  }" o
        else clone 1 load to P_pick3
. f  l: H+ z5 ^6 q; l% t* qend6 }' V( z, ^3 N
6 T+ W* [  H5 D# Q7 e) o0 B
begin P_pick1 arriving
6 U/ N, B4 U/ ?0 j) \: P    set A_i to 1
3 l: s. k( a4 U$ W/ A, z    move into Q_induct1* s+ _7 `4 |7 e; D1 w
    move into pickaisle.induct1' i/ b( A+ e: N. {- `
    while A_i<=30 do begin4 ^( w) F* I- U8 c+ ?
        travel to pickaisle.con(A_i)6 z5 G! ]8 B5 d. b* r, Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B, s5 R# ~  i4 B3 m; ^! q. E
        else wait for 10 sec$ l/ K9 z7 o' `( k
        if A_i=A_leave then send to die! \# i8 U5 D2 i& D
        else inc A_i by 1
+ z4 R: p, g; O0 m' U    end
( C8 T" ^7 s+ V/ k* Q  oend: X* y7 G  f+ Z

* H; q4 {2 n7 s- j! p! wbegin P_pick2 arriving
( M6 I, Y! y- q3 N* ?4 A, v+ X    set A_i to 11
7 i5 T, ?% c" E  L3 b! h    move into Q_induct2
3 e+ \# G$ y1 J! r+ Q) r    move into pickaisle.induct2
- h; @- J$ J0 N! O7 ]    while A_i<=30 do begin: ~; u1 J( p: F# x4 B9 b
        travel to pickaisle.con(A_i)/ ?+ Y# @: ^" o1 j$ U  I- s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c7 F& U' ~! h0 a: N: Q" I        else wait for 10 sec
- _  K7 Y  g" p, O* b  O, ~  v        if A_i=A_leave then send to die2 F) x+ B5 I$ e3 y
        else inc A_i by 1
- c4 A5 ^5 V2 \# U* g" j$ i+ \! F, e: W    end, x3 i% U3 G4 g+ G9 J6 n; p
end
5 K# [" a9 i" k1 F% ^; H4 Q8 p6 `( O8 G
begin P_pick3 arriving
( E, g# `' |% h    set A_i to 216 |/ ^& w% i6 {: _  O# Q
    move into Q_induct3
& E$ \1 Z$ H# w    move into pickaisle.induct3" h7 J  ^2 m9 t3 h. i& W
    while A_i<=30 do begin8 t  c/ ?2 t6 r- V
        travel to pickaisle.con(A_i)5 t5 N! ]* n# w) L0 y: Y& o+ c$ E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, U% t3 s, n- _% U; w7 H! h        else wait for 10 sec
: Q9 P9 @  S4 Z( B! @7 }  X1 s        if A_i=A_leave then send to die3 C1 Y+ i) |: l+ I
        else inc A_i by 16 Q/ r! G1 O- N: L# g
    end
# a- K) S1 v. wend

最佳答案

查看完整内容

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是个什么东东?
* S! K! \( n9 z  A: b" bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- l0 k9 k& p1 a; W9 z$ {/ I. ]: {" s. y7 I8 ]+ h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 o  \! a# n6 M  ]# j8 e9 t+ P- ~2 n$ z, n; F% `2 m& K) H; x
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) U% |. f& e) ^  S, c1 B6 P! t
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 t# S  O, x7 ?0 d9 E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  w2 e! T1 I" Z1 v1 i" D$ o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ h/ |3 t3 b5 j8 |8 ibegin P_induction arriving" f3 {9 C, i5 w( B
    clone 1 load to P_pick(A_induct)
; V+ M# T& X. n! k5 N" I% P2 W! v3 _end最大的系4 O! s  _+ C2 v

7 b4 L; K  B  B( \$ Sbegin P_pick arriving% ?1 J8 B$ t3 a+ [+ Y+ M$ N
    set A_i to procindex * 10 + 1
: c! v9 R8 H- @; r/ V% a/ t) n+ x    move into Q_induct(procindex)
1 K* d. a2 @0 v: P3 s    move into pickaisle.induct(procindex)
- B6 V5 `6 C. Z* k; J    /*check the type of pickaisle.induct(i), for your last problem.*/1 M' _! e+ o6 z1 T! f

" D4 e4 J5 _6 ~9 n2 V    while A_i<=30 do begin* q- S* R8 R+ l
        travel to pickaisle.con(A_i)
# A- w# L" X; C  H( U/ h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 N, s# L* L2 s& U/ p7 y2 K        else wait for 10 sec4 h/ x! [' f# v' Y
        if A_i=A_leave then send to die
: B; B4 G0 |; H4 b% y2 ^- ^        else inc A_i by 16 `" A! `) X; {- \  Y
    end! C; T# d/ k9 ^1 F: D8 Q+ H2 s
end* W7 g- T( B/ b8 u1 O$ {6 i

' c6 A3 D0 p/ @5 W9 `其中的procindex为整形,代表当前process的序号。) q' b+ ~/ o( i& K; t
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-8-23 10:35 , Processed in 0.019783 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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