设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14908|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- B# j# x) n: F$ }
! M0 y! O7 [! }我的问题是,在每个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中的数值,不知道会不会有什么不妥。* W/ i' i! f. N  n
; d" z+ t9 n+ s7 z7 a+ z: G% B# C
begin P_read arriving
$ S. `! T0 r: }    while 1=1 do begin: ?! W5 A# Y( l/ ]4 ]$ W8 u
        read A_tote from "data.txt" with delimiter "\n"+ U" u9 w# P" \0 c  ]6 [
        read A_time from "data.txt" with delimiter "\n"
  S- i& C3 A- z; I6 E        read A_leave from "data.txt" with delimiter "\n"* M1 S5 O- z! |! [
        read A_picks from "data.txt" with delimiter "\n"
) m) D5 B" ^* W* U        set load type to A_tote; I. y8 S7 _7 X9 ^
        if A_tote="tote 1" then set A_induct to 18 b/ Y( S1 |1 E- j1 J8 }
        else if A_tote="tote 2" then set A_induct to 2
! B. n9 h! G* |7 W3 N( }  m            else set A_induct to 3    & n  O# h. r6 }! A
        set A_i to 0: u- r6 ^4 R6 B1 v) x4 E6 z
        clone 1 load to P_induction
; W* o$ L! e6 Y* W& D& k" x& F        wait for A_time sec5 i: |* _) @. e
    end
5 i2 b, W8 r- d; s2 ^% {end
; j1 f1 h2 [2 J3 f, H
6 W( x  n1 ?4 jbegin P_induction arriving. A& H. w+ }- Z; e
    if A_induct=1 then clone 1 load to P_pick1
& ~& o9 s  V8 I4 j- @( v    else if A_induct=2 then clone 1 load to P_pick20 u3 l6 w( s! d) N" X
        else clone 1 load to P_pick3) R6 V& V2 b" H. B# _7 T3 W
end
& `/ |. d* E1 v3 E; [5 R* a3 v
" F: ^/ _- B) B" c/ ~2 W- Nbegin P_pick1 arriving2 a9 Z5 i/ s/ w& O! O9 }
    set A_i to 15 a& l5 |4 E+ Y' ]
    move into Q_induct1; V* \" C. o  E; @, D+ X
    move into pickaisle.induct1
7 n8 C8 |* D: L8 U/ {    while A_i<=30 do begin
. f9 p& u" @# c2 ^# P        travel to pickaisle.con(A_i)
" D8 f. v. g' y5 w4 x2 X& S3 V2 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 X- H8 h* l9 Z, |" F9 J$ s        else wait for 10 sec
; `& f5 D( J* w7 h; e' ]( K! g        if A_i=A_leave then send to die/ n1 O* L" q. B1 z$ V
        else inc A_i by 1  `3 L- S5 k3 M2 \' z
    end
" @& b0 t. `- A6 g/ T" D6 e, x! i" \end
# s8 h! S. x+ y7 D0 G, k+ {+ `: J& ?* o; d* k
begin P_pick2 arriving4 s4 w* {4 R% A4 a! ~2 p. R. ?1 C
    set A_i to 117 q  K3 D0 p7 W6 w
    move into Q_induct2! E! ]" v' f4 h5 J8 h
    move into pickaisle.induct26 V; ^+ ]  z% j
    while A_i<=30 do begin
! {3 N- K, W: Z  @, P; Y( w        travel to pickaisle.con(A_i)
' ]" K, E3 g8 V5 Z: e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! a. N- }: f9 Y% J# j2 d3 A
        else wait for 10 sec1 H+ a* [/ s/ a
        if A_i=A_leave then send to die
* N# U8 Z3 J6 H! p# J' f4 S        else inc A_i by 12 q" P) S- {8 |
    end
- V8 Y3 i; }- `9 f. xend
4 U, F5 `% V1 m" p" n& e0 v5 `. \6 H! p% b$ _4 e( X7 @
begin P_pick3 arriving
2 }3 n6 v9 \/ I& e    set A_i to 21
5 h# X+ F3 E: v7 Y$ i1 I7 K) N8 s    move into Q_induct3. o* A5 ^- Q4 Q& \% l1 [! |
    move into pickaisle.induct34 I% }2 y1 A% Q* u4 q# \
    while A_i<=30 do begin0 T- z; _1 ]4 y3 G- W
        travel to pickaisle.con(A_i)
4 q; ?, C9 n# b& S. y+ u  T( {1 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 e4 h- K( t$ o2 o7 @( F8 \        else wait for 10 sec" N9 R% `5 @% @8 Z+ c) i# Z
        if A_i=A_leave then send to die; E  `( f& C6 [1 ?  p) D
        else inc A_i by 13 {+ C( c; v, q! X) K2 Z, L4 y# {; z
    end
1 |7 W. c5 l+ ?8 @  j7 R& N4 |/ Gend

最佳答案

查看完整内容

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是个什么东东?
; V+ |+ S7 e" P7 R' Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- ?5 p' V0 q2 M/ L  e5 f) \5 e9 Z7 ~1 `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) q0 ^3 e3 }3 Q+ {" y

* {* |0 N( _) Y2 ^' b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" u' z9 M/ u) l! E, P/ R/ ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 X0 `' w$ d& }( E% `3 v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% n/ @, T0 }8 w- u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, X4 `3 [7 b- D! L$ I2 z
begin P_induction arriving8 n  S# z2 [3 R
    clone 1 load to P_pick(A_induct)3 A7 Q7 ?; S2 ]7 g, k) j" o# [) R
end最大的系
( Y& j, b( p9 X0 J9 f% ~/ x3 [: j( U) v, e! ~/ F" y
begin P_pick arriving
+ Q: L1 y8 |& r$ m, g, e    set A_i to procindex * 10 + 1
4 O+ D, N& [5 B# h% y' O( u    move into Q_induct(procindex)
( a" M6 F% A- g' v- T    move into pickaisle.induct(procindex)0 y3 e/ T: V2 U
    /*check the type of pickaisle.induct(i), for your last problem.*/1 m+ b$ i) g* P

. {" \+ V4 ^: B    while A_i<=30 do begin0 h! R  F+ ]! x" C) j
        travel to pickaisle.con(A_i)# D7 m; P* |7 N' @4 V7 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 w8 E+ X0 T7 ^! n+ S: V, Z        else wait for 10 sec! H" v9 c# P) l" e. S4 R2 |
        if A_i=A_leave then send to die
( z3 a2 h* i/ \3 H/ O8 H        else inc A_i by 1& W0 K, j2 h8 b' \9 O$ J
    end
& U# j% L. h; w) q  m. W& ]end; c3 Z8 K6 F* f' N! y/ [9 A/ q

3 @& a7 O4 S" W% N& V' J% p其中的procindex为整形,代表当前process的序号。
$ z0 q& k0 \' t; ^( y! [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-30 20:48 , Processed in 0.017030 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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