设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14713|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ R' X& m2 W) G/ J' l

- S- J5 l8 S' m/ ^我的问题是,在每个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! q2 g/ N+ O" U8 _0 h

4 Y7 s  z/ U: Cbegin P_read arriving
" u- V1 U( M/ H6 b; T    while 1=1 do begin5 E; [& V! r: o+ r  X, ~
        read A_tote from "data.txt" with delimiter "\n"
& }9 m0 S' f6 O        read A_time from "data.txt" with delimiter "\n"
8 R$ i$ t. d" f        read A_leave from "data.txt" with delimiter "\n"
* o" X, I, {. _        read A_picks from "data.txt" with delimiter "\n"3 J, t# P# j" k) |% ]& N+ z" n
        set load type to A_tote
* {2 p+ z+ W+ ^$ g        if A_tote="tote 1" then set A_induct to 1
3 Y( Y7 t5 [; |) r- Y        else if A_tote="tote 2" then set A_induct to 22 k# V* q- W8 Y, M+ B$ m5 n! U8 s
            else set A_induct to 3    + f: }# M' T2 M6 {' s
        set A_i to 0
0 |# \' q% W" t        clone 1 load to P_induction0 Y, Z- [7 u; @4 m- p
        wait for A_time sec1 p) M1 |7 I) l7 f+ Y
    end
5 i' S# F# U9 {6 p; ^, r8 y  n$ vend; q4 n6 W  t- z" \" B( E' T7 ]

# ^" ?( k4 u( B  ~" Q. v- ubegin P_induction arriving) W- s# \) U4 a: @, _" V6 U$ M
    if A_induct=1 then clone 1 load to P_pick19 C- i& V# _5 [; F( S' n
    else if A_induct=2 then clone 1 load to P_pick2
; `0 i' t6 c  ]8 a! `4 C# A9 t        else clone 1 load to P_pick32 _+ [# L4 B- f% ^; l! D! `4 h. S
end9 G3 u; j% D, g- @

3 J# O& M9 G% sbegin P_pick1 arriving
( a8 ]/ Y; J* B" I" J, g$ ?    set A_i to 1
7 ~! T# }; ?/ S5 F) W. \, O9 R    move into Q_induct1# J* ?* {8 N, p# k* w
    move into pickaisle.induct1
( K6 J, P/ E1 K$ V    while A_i<=30 do begin
: s/ [6 t. q' n: ~  k: Y        travel to pickaisle.con(A_i)
1 b+ G  N  s( S! x7 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N$ m( C2 u6 L4 h" d1 K        else wait for 10 sec
" l' z+ j# h, D+ L) U) b        if A_i=A_leave then send to die
6 `8 f8 ], c! M        else inc A_i by 1
" K, a. D( ^8 z6 `- _+ o    end
* d# B3 k7 [! @9 lend
# a1 R% e- W0 q! G  H: ~! b
& D- ~4 j; y" D3 J7 lbegin P_pick2 arriving
% o5 R& h: M; ?; D5 {, P( B' h    set A_i to 11
- `: Y. v7 @$ P/ k- `. A    move into Q_induct28 e5 f, ?2 z% C0 N
    move into pickaisle.induct21 `/ {  }& T2 r- X
    while A_i<=30 do begin' q  |, ]7 d; g  w
        travel to pickaisle.con(A_i)
  V3 e7 C& y+ X  ]9 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j: D# d- e  |- `& N        else wait for 10 sec
  v" J& T$ S! n5 q1 Z2 v  i        if A_i=A_leave then send to die+ ^5 H7 D0 y' o: i; d3 H' o. I
        else inc A_i by 12 w5 W$ [8 p5 i$ v% ?( o
    end
( w8 n7 N7 f3 oend
( k2 P7 N7 c; `/ h6 w. Y. d, {
7 _% [. p4 a: W; m( Ubegin P_pick3 arriving
) k4 k( K' C6 b3 P0 [    set A_i to 21+ U% n0 T% b5 f! o7 ?
    move into Q_induct30 v4 |) u0 j! L  v# v, d) d: \
    move into pickaisle.induct30 g7 k2 h: k& d, Z+ U
    while A_i<=30 do begin6 o) g! [! f' Z: t4 C+ @2 L. k; J
        travel to pickaisle.con(A_i); L1 \7 k  }. M2 I4 Z# b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ?- X& d0 ~  L# ]9 _' D, ~. @
        else wait for 10 sec
" x2 A6 ?+ D8 a- m6 z        if A_i=A_leave then send to die
! P+ U1 @4 V5 a3 Y( X        else inc A_i by 1
2 C* n4 s" X6 Z. N! [3 [8 }6 O    end
$ N% g$ U: b* |! Cend

最佳答案

查看完整内容

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是个什么东东?  q/ A: i) b6 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" Z4 B$ V  P8 W! G. e1 _9 T' }
& q' w0 ?" }/ N( F: Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 }; L% W2 \- n3 r
. {+ ]$ w- R" I; y* U3 r  Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 Q, M, b7 E% B$ H. I, ?1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, ^9 M1 S, S  t5 @& J  t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- f7 d3 Y3 l/ }* E  t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! P' g9 c4 c! Rbegin P_induction arriving1 u  O8 @& m* {) p
    clone 1 load to P_pick(A_induct)
1 ], p1 x, }6 O' Gend最大的系" n0 g, V$ w" D9 Q

( o. O3 F$ G$ M2 B5 Vbegin P_pick arriving  Z/ w( W: w/ Y" d0 c
    set A_i to procindex * 10 + 1/ W/ q6 H/ O0 H1 `- {
    move into Q_induct(procindex)  d6 k. m+ \3 x
    move into pickaisle.induct(procindex)
0 U# A3 B4 h5 Q" X1 D) k- I    /*check the type of pickaisle.induct(i), for your last problem.*/
( M) |7 {$ v5 {# a+ Y4 B0 ^% N
* [8 e: {8 G% K* J: D    while A_i<=30 do begin& j8 R' Z! q4 w* s: @3 d3 {
        travel to pickaisle.con(A_i)/ t! p1 E+ U$ u5 E% k# k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* m* Q  ]; ]7 B2 H1 m* f
        else wait for 10 sec4 T8 M  c$ ~, f( o0 O
        if A_i=A_leave then send to die; t0 T) ~! V" l( z1 O
        else inc A_i by 1
7 ^& Y  v7 L4 F% y    end
, U4 N3 X, F' y6 D0 M! {end
/ X* D- |8 j* n& [/ g2 p' O1 L8 N+ F5 q5 t2 I8 z
其中的procindex为整形,代表当前process的序号。* @; @$ L3 r" j$ ~. Q( Q
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-22 15:46 , Processed in 0.013633 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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