设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13886|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ u/ q5 b6 H: ^' L/ L7 }: p5 R! R  k$ h1 P  p, q! [; L8 m) K8 k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 e( D* v  v5 A0 r7 L& g, e

; y9 a* l" {7 Q& q1 A: I2 z3 G( ibegin P_read arriving5 [+ ~9 c6 u* N6 E; I& o
    while 1=1 do begin
* Y- \: y: I9 y# }- n* K        read A_tote from "data.txt" with delimiter "\n"
  j" y8 Q( j" b( u        read A_time from "data.txt" with delimiter "\n"  M& ~6 M  a# U8 l1 f/ T
        read A_leave from "data.txt" with delimiter "\n"
/ k; H; d& s) p+ A: N. {6 @        read A_picks from "data.txt" with delimiter "\n"9 u# B  F4 O! K9 @9 n
        set load type to A_tote
1 [1 t$ o, Y5 D8 [        if A_tote="tote 1" then set A_induct to 18 ]' Y% T7 ?4 s0 i* l$ T' a! K
        else if A_tote="tote 2" then set A_induct to 2& J" O1 n  R& j& Y
            else set A_induct to 3   
- ^0 ]+ W* @0 Z3 x        set A_i to 0" v: I$ `% ?( x
        clone 1 load to P_induction3 {' i7 G# A! A
        wait for A_time sec5 F/ r8 @: s$ |7 L/ @& c' E# M
    end+ ~8 A( I" g/ D& P5 b" e2 Y
end  I1 L* c. ]  m( O. o1 s% N
# w2 H; Y5 T. X5 U# Q) c
begin P_induction arriving
- d9 b1 y) ]0 t# s8 p5 X    if A_induct=1 then clone 1 load to P_pick1# c; o" ]1 J* ?$ L2 Y
    else if A_induct=2 then clone 1 load to P_pick2, S3 N$ c$ P/ C4 l9 [
        else clone 1 load to P_pick3
4 g4 i6 o, d; l6 w/ h: B% A5 jend, l0 W3 G; `# u. _$ D! q
2 J! r3 [, ~! U7 H( W( d7 i0 f
begin P_pick1 arriving4 O) B+ L8 N/ r/ O$ N  t1 x0 }
    set A_i to 1
1 k% @/ p$ c( g4 r$ [  f/ q    move into Q_induct1. x) k, L1 Y. N; D! z
    move into pickaisle.induct1
' Y9 Q9 \6 G5 m    while A_i<=30 do begin$ x  i1 }- B4 c7 m3 D' `9 A) Z
        travel to pickaisle.con(A_i)
( |8 J! c' O# L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. s% K& I* m6 p6 ]& V
        else wait for 10 sec! S5 {6 }( ]* Q, \9 E
        if A_i=A_leave then send to die
# O6 a3 v# J& s& e        else inc A_i by 1
# y$ s* j% `( j& L    end) V1 |, i' g- s. s
end
$ z" y: `# F; J$ F* u
' _- V, a1 a, ^; O0 K- R  W! }/ fbegin P_pick2 arriving5 n) L) D) P2 O9 K6 P( k$ ~5 c
    set A_i to 11
) {3 h9 n0 y  Y4 i# A/ I( k    move into Q_induct2
& e# D* D1 c  O1 E5 V3 ~. [    move into pickaisle.induct2, a5 K, \" t+ C8 J
    while A_i<=30 do begin) l' o$ m9 f: C! b' C4 O8 T1 h
        travel to pickaisle.con(A_i)
( W- N2 X' F% ~& k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 b$ p% \& D9 E4 P5 B! ~1 I  H        else wait for 10 sec; S) E9 w. B1 K4 [
        if A_i=A_leave then send to die
4 x, G7 S' r8 J& M, e        else inc A_i by 1
+ j/ e& G2 g4 P( U5 G; o8 o* _    end" Z. x$ a* f* C. M" `& c
end
/ p$ ^: K4 t; j, Y5 g/ e9 U
% Z: k8 n: K: C% _6 }begin P_pick3 arriving
5 R) e3 S, Q) R) U) y/ o2 c    set A_i to 21
  [' @0 X5 K- Z$ Y6 i2 _  N5 n    move into Q_induct3
) O4 I: F; f9 }% m$ B8 d8 O* u# U; f    move into pickaisle.induct3
5 K$ |4 f% R8 y6 o6 y3 Y% s    while A_i<=30 do begin
( f9 g$ M( g4 s7 K' I& A        travel to pickaisle.con(A_i)
2 I" v4 J. m0 ~0 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) e) d# x% G- l% a1 T        else wait for 10 sec* }8 Q& c0 W9 z& N. R
        if A_i=A_leave then send to die
5 m( K$ Y$ e- M3 [  ]        else inc A_i by 1& B- X# w( {: T1 m+ V2 s  p. U
    end
5 u1 j% B# j8 S3 [# z7 o# F4 hend

最佳答案

查看完整内容

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是个什么东东?
& @# L$ {$ Z; g0 y/ Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 y: s* V( G8 k- a1 P0 x

+ I8 [0 t+ `2 u) ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 }; O" S# Y$ n2 M' n. Z0 P3 g; O2 w/ \2 j. n, ^  c- K7 E8 ?9 ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! e: A7 V' S' B- {! v( t1 l* ~1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) f8 n! |& ?! u; E  T- m  U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' ?: @& S7 i! K1 ?$ {8 c7 f$ X9 l, `8 I
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ ~9 ~8 K3 c  A6 ?  z. y, Fbegin P_induction arriving( G9 l: x) X# {9 @( P* V$ Z
    clone 1 load to P_pick(A_induct)
1 h# A5 Y! Z" j" j$ A! |end最大的系, k" q8 K5 v* X
7 M% @' Q0 ?7 \7 Y# R* Q4 [
begin P_pick arriving" E$ v% m4 R& S$ q' E
    set A_i to procindex * 10 + 1& ~" A. `( x( c- H0 f: W7 n
    move into Q_induct(procindex)
7 x* Z7 u: y, W9 P: z: e# M; a    move into pickaisle.induct(procindex)
1 ^! l- Q4 L; M9 D    /*check the type of pickaisle.induct(i), for your last problem.*/
% p3 u/ C& N- z/ I! a( {
& H9 R1 F9 D+ ~( M. U5 m% j    while A_i<=30 do begin3 x/ G8 _) C) x* Y4 W- P9 M( P
        travel to pickaisle.con(A_i)
% [2 @( P1 y- x  O+ ]/ i0 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ^* E/ K/ F7 H+ g+ q$ l& v# t        else wait for 10 sec
. |. X  t7 G8 \5 M; _# @0 D) O        if A_i=A_leave then send to die
# \( m/ p& Y  k        else inc A_i by 1
- R3 u: b+ m6 f: W  m. T* b    end
8 @4 v. m. P6 \/ U% x4 {end1 F0 s% k# n' A
# V. {: O/ f# s- R
其中的procindex为整形,代表当前process的序号。% C9 b- w' U% X4 K1 ^! _; b
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-5-14 16:05 , Processed in 0.017844 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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