设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14382|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, Y9 q7 n  w# K
6 ~+ S% b5 ]' L我的问题是,在每个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中的数值,不知道会不会有什么不妥。: E( [* m- ]& T$ q

  F# D% n1 `/ vbegin P_read arriving8 f; `% I( e2 d) j9 n. V, k( I
    while 1=1 do begin
# O  J9 u1 F* [8 J- ^1 d4 F/ y+ \        read A_tote from "data.txt" with delimiter "\n"
* w$ P0 v, p+ [  r. }        read A_time from "data.txt" with delimiter "\n"; Q9 q$ j7 s2 c7 E
        read A_leave from "data.txt" with delimiter "\n"
$ L9 L0 z7 |) \9 A3 T+ t7 W        read A_picks from "data.txt" with delimiter "\n"! B* W5 V+ S$ x  j1 h6 Y( j
        set load type to A_tote, i+ y' v; b9 \$ b% C" h
        if A_tote="tote 1" then set A_induct to 1: R' O1 O  e# `" d' X0 S
        else if A_tote="tote 2" then set A_induct to 28 c% a, v0 t2 H
            else set A_induct to 3    ' H' W& M( w9 c& l
        set A_i to 0
, L9 s9 n" {5 I, K6 j        clone 1 load to P_induction( f. b/ Q- k2 f( q( a& x4 k
        wait for A_time sec& X+ q0 ]. v4 ?* T! O9 K9 U9 o+ B
    end# |, [; a6 l8 L
end# r% E$ m: H* a2 Y$ z
6 h8 G6 Y4 @5 h1 j, ]9 g0 @' l2 t
begin P_induction arriving
4 W3 p1 C, N) D! b    if A_induct=1 then clone 1 load to P_pick16 v; [0 q- g! l3 K& b% m
    else if A_induct=2 then clone 1 load to P_pick2" N4 y2 m# S# y( h0 `
        else clone 1 load to P_pick3
! V9 R% i" V$ q( N* Z7 F, k2 x5 _end
; G  p! A. C) e$ k# M, o
2 ?, K( B* q6 z; L3 ?4 r' Q- wbegin P_pick1 arriving
: i. \: m$ ?- j) E) O  [- \* v    set A_i to 12 z' G; B: b( P$ `. E4 F- V
    move into Q_induct1
# Z% f; D- \4 q    move into pickaisle.induct1
' x4 ]3 Z- u4 \- J% r    while A_i<=30 do begin
9 T/ P3 I: f" h) s  M) `        travel to pickaisle.con(A_i)7 d# J( t& l- h5 z% {9 `+ N. I- e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 l; c% I# R. y7 P/ [: M
        else wait for 10 sec6 H, T* J2 |7 S% @
        if A_i=A_leave then send to die- B* k  k2 \/ S& e
        else inc A_i by 1
& O4 Y# ~- s% ]    end
2 {! a& U$ k( O0 f5 z$ O1 aend3 F$ {# F+ @% C7 Y9 r+ y) u
- S2 _* C* E* |% u2 Y
begin P_pick2 arriving2 W9 d4 Q% D# z4 J2 |
    set A_i to 11
* A# |4 r# M: F: W: S    move into Q_induct2
' _+ T7 l+ o8 X+ Y- S5 f. x1 g    move into pickaisle.induct2
$ Y6 V) Z! t3 {( |4 n    while A_i<=30 do begin/ Y! V  K" q* e( q. M5 f
        travel to pickaisle.con(A_i)
, H4 W9 x. e( R8 D; }& q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w6 B  F: x* Z! e( @
        else wait for 10 sec/ `$ Z7 P  C! m! @9 f
        if A_i=A_leave then send to die
* S# [& O& O3 k/ i+ H/ g" o& v' i2 M        else inc A_i by 1
$ e% O' z4 I( @! E+ _- P# ]    end
* S! M' I  U6 G; Qend
% _2 T2 n  a; S+ q& x' f2 l) s. O' W' V, B7 n: J  \
begin P_pick3 arriving
, u& w( _) p! I- [. d) _6 O6 s    set A_i to 21
9 P- X( C3 I* L% @# ^& @    move into Q_induct3
  h* C9 O, V) S: x    move into pickaisle.induct3
5 {0 _/ Y4 x6 [    while A_i<=30 do begin( }. Z- V, \' d" Y9 v2 A( N6 x
        travel to pickaisle.con(A_i)
/ S# l7 e4 x" A! _! L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 d( x+ c" _% z+ m9 g! p% \        else wait for 10 sec! q) `, e  D0 |2 d1 A
        if A_i=A_leave then send to die- w- P, Z8 H+ y) ~
        else inc A_i by 10 h4 X) }' r( T# d( m. Y* s
    end$ Q4 o/ z0 C1 i, }. W7 ]
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是个什么东东?  B7 W& i% t6 W' |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) O5 P/ ]- v5 [7 S$ V" j9 Z( m3 K4 z0 ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ w& o5 R# z" \" z! A0 m2 x* _) p& y

% _: t0 H  M* `' w* y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% _: c% ^# C, U! L1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. J$ c& l2 U% `5 Y7 z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* D( n* b: K) `+ o0 o; e" S- v, v& J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 J1 W, W# z1 E! I; b! [begin P_induction arriving
* i- z# R" C# I0 o3 ^' P7 n0 D2 m    clone 1 load to P_pick(A_induct)
* s" P( s% D3 B" f) s) {; qend最大的系) p$ g' S# j4 A8 s* d9 F
; _& u0 t/ G: U  k
begin P_pick arriving
4 r5 u. n6 S: t    set A_i to procindex * 10 + 1
0 _, s0 U5 E2 F  W! p    move into Q_induct(procindex)7 t8 g) `/ G% H$ x0 F: a) C
    move into pickaisle.induct(procindex)
3 }' t2 q, x, \/ H0 A7 P+ \    /*check the type of pickaisle.induct(i), for your last problem.*/' ?( M% n5 T+ B9 d$ O

( P. V( g' U* o$ `5 ]: H7 F    while A_i<=30 do begin
4 l) t0 U0 {' p/ @6 [% ^        travel to pickaisle.con(A_i)
. v" t% c+ B( t5 F- p3 V% y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* y: b1 z  l* ?2 M) f- p* d
        else wait for 10 sec
  r" S% w! c6 S9 ?( |9 T        if A_i=A_leave then send to die. }1 x9 n8 y, p. `# H
        else inc A_i by 1
, u" T- d$ z: c0 p1 D; k; [    end" _8 P: j' [7 d6 ]4 k# d  n& X
end0 ^7 V' P* `" I/ i2 ?  Q' j
& J2 i3 r; h2 p; R6 E' I. h, I
其中的procindex为整形,代表当前process的序号。' k3 U% X1 Q1 M, \9 ]6 d% N$ F% e
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-7-9 04:43 , Processed in 0.020867 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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