设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13694|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! i: Y# @# q  m( `) l* f
% L+ x- s- C, H6 T# I7 f% N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 W; ?9 n" c& C. l4 r) u: E* k0 w4 @2 j) V: P; F
begin P_read arriving
* S6 L8 H0 [: K+ L    while 1=1 do begin. d. m& J: P5 s, V" s- x
        read A_tote from "data.txt" with delimiter "\n"+ X/ X  \. S0 ~, S' m; S$ \( Z
        read A_time from "data.txt" with delimiter "\n"( J- v& W, x& K3 V  k8 K9 [( Y; h
        read A_leave from "data.txt" with delimiter "\n"/ ]1 O) j5 M: B9 h* M
        read A_picks from "data.txt" with delimiter "\n": j1 x4 W+ i8 V$ ?
        set load type to A_tote+ z  N+ l7 b* _: S: }4 }
        if A_tote="tote 1" then set A_induct to 1
8 o, L* e7 P; J+ L" ?+ ?+ K# n+ ?1 Q        else if A_tote="tote 2" then set A_induct to 2
" H6 z8 J0 a0 X, v0 G: v& w7 X            else set A_induct to 3   
. O8 B; i! |# c        set A_i to 0# v8 t. i: w  k3 ?$ q1 f
        clone 1 load to P_induction, t3 F2 V: m2 }
        wait for A_time sec: X' @4 x! p& X
    end# u- A5 l7 _1 E, D& x2 J
end
0 _$ B1 z3 v4 T
0 j  ?0 }4 Z, q: @begin P_induction arriving8 b/ [2 S2 d8 o, m; z1 O
    if A_induct=1 then clone 1 load to P_pick1" ]% x8 k0 y& X3 ^8 Y% m
    else if A_induct=2 then clone 1 load to P_pick2
& s- ]0 ?: o% b# D2 R/ {        else clone 1 load to P_pick3  M) s4 [9 ?5 M5 |0 I) W/ `
end+ ~- f  g0 f% _; K

8 K4 [, A. J) K& Rbegin P_pick1 arriving
9 i; A0 L$ P9 j  g$ x    set A_i to 10 p2 a+ {9 ~% s
    move into Q_induct1
* W) ^5 o) S6 L* |' w9 p    move into pickaisle.induct17 G1 m" A; t% A* ?- t5 c$ D& [
    while A_i<=30 do begin
- p4 \4 s& f' J& f& s+ T: M' v        travel to pickaisle.con(A_i)
- S+ Q0 x' ]' ^* K8 r: L. b& y/ D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( @7 D' Z- v' ^
        else wait for 10 sec+ m: W/ f) k0 n# \4 O+ V! n1 d, Y! t
        if A_i=A_leave then send to die
8 k+ c# t8 c0 C/ \9 w# [        else inc A_i by 1
- J! ]# Z* P/ L! F. v    end* P+ m; {4 @$ F$ v
end6 D: w, P& K: `$ v

( P7 _) H; ?  H) c" R5 abegin P_pick2 arriving
2 h( |. D3 U, W' [. U8 Z# g( Q4 |    set A_i to 11( `9 ~1 k: C  w& s6 A$ }' w
    move into Q_induct2
, y7 L9 w8 n9 }2 W8 u    move into pickaisle.induct29 X$ A$ x8 q: w$ N0 `7 _
    while A_i<=30 do begin
% m& B9 Y* r5 {  Q: Z- h/ A        travel to pickaisle.con(A_i)
. `4 y' j9 q2 y0 l: l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: b+ Q9 Z0 N+ h
        else wait for 10 sec% s7 s& c, F3 \& I: [
        if A_i=A_leave then send to die
4 V( ?7 _0 m/ Z* F. t        else inc A_i by 1. G. h* v' H( [8 j& f
    end
/ y2 @  q' @6 k1 c. ]end
# [5 c- l5 j9 g6 Y4 r% M1 L, d7 W0 S% x# N
begin P_pick3 arriving; S2 p  b) t" }( a# T
    set A_i to 21
3 y" C$ P, T. G    move into Q_induct3
2 Z  V% ~" s4 A( s    move into pickaisle.induct35 G( W6 c# |* Q# t8 ~- q
    while A_i<=30 do begin5 l* \/ B; H4 v- `. J, x! a/ s
        travel to pickaisle.con(A_i)4 \2 ^9 N# }8 v, y2 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 j' d* W* d9 R) ~* ^5 v0 G6 H
        else wait for 10 sec
  u1 {, e; Y. y4 }6 P) C  a        if A_i=A_leave then send to die+ q8 w7 s3 n0 I1 E+ ^8 q
        else inc A_i by 1
( O) T6 T; l$ S6 b7 e    end
* q" [: s- 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 c; D' L- D$ M3 Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, _$ m( n# j/ _4 J9 H$ m' T
8 w! b: O- c# x4 i  z1 v( JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 D( q. ^, w' k# q/ ], \
# o) J, h; v5 X+ `. k) l: y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 q3 i2 `" l- ?* U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 l+ M  |8 x3 v0 X# P/ s& K: n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' F" G- x% c( C9 I' c0 F6 [
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: Z0 O. x7 E/ a7 Q" i
begin P_induction arriving
0 k& w5 S0 _! c7 v    clone 1 load to P_pick(A_induct)
8 _0 _) t, @4 N# \3 fend最大的系
$ D, H' r! s1 I( e0 y$ a# ]2 k% g* J5 y
begin P_pick arriving5 T$ h- o$ r' r! E" y. E1 [% m& c6 T
    set A_i to procindex * 10 + 19 w+ F  E3 e, z$ e6 x0 T( N
    move into Q_induct(procindex)
1 x/ r, b7 w" r2 T    move into pickaisle.induct(procindex)( R) ~$ h8 k+ J4 U2 |2 o7 H/ E
    /*check the type of pickaisle.induct(i), for your last problem.*/4 O$ s: Z1 b" x0 L' ~: d
$ F2 A4 _: x* q4 m# |1 c
    while A_i<=30 do begin
, D0 v2 \5 l, l' I% \; Z        travel to pickaisle.con(A_i)) }1 w7 @5 G, I. ^8 a: l* A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* w  D- H% P  j. s. q0 j
        else wait for 10 sec
6 M* V8 W- M7 c, q+ }! Y8 n        if A_i=A_leave then send to die6 K& z3 l7 s0 h  J" u
        else inc A_i by 13 r9 L4 h4 p6 P0 d6 r
    end
, U) Z: p# \2 Z- e6 x/ O, G6 w  fend2 |+ Q, ~6 Y. D6 R

/ C4 Y3 T" R- h( t' N其中的procindex为整形,代表当前process的序号。! h+ F* g7 ^1 n. O1 y) c# H
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-29 08:26 , Processed in 0.017269 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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