设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14435|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 \4 }3 C5 v- G# k0 i- V) m' {
+ S) ^4 I, Y9 }我的问题是,在每个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 S  [" {5 f+ o+ l2 c
/ R4 Q$ R$ s0 J, Y/ }+ S0 o
begin P_read arriving+ g+ L/ b. I$ i1 m+ `$ s
    while 1=1 do begin
  M2 S' R4 l* [7 w; j8 Q2 X4 G' n        read A_tote from "data.txt" with delimiter "\n"
) E0 K( G7 S/ Z2 {* G8 w+ Z        read A_time from "data.txt" with delimiter "\n"/ I8 H- Z' n. ?
        read A_leave from "data.txt" with delimiter "\n"
- J/ V* u, M8 u# H        read A_picks from "data.txt" with delimiter "\n"
. n* Z+ \' W/ P        set load type to A_tote% @; d/ m4 X+ M+ R
        if A_tote="tote 1" then set A_induct to 1
3 v& M9 E. w, |        else if A_tote="tote 2" then set A_induct to 2
% X* l3 Y6 U+ n5 b            else set A_induct to 3   
! b& L! b2 j$ T        set A_i to 05 v2 g8 c! r3 e' ~
        clone 1 load to P_induction
) I; P* W9 f; l8 P0 t        wait for A_time sec
" @0 f) p: R% O! p$ J, w    end
; q3 [8 K6 l1 k9 Z. Q7 fend# E  F  v0 F/ T: u" ^2 d
8 G( [1 ?' e1 L( e% \
begin P_induction arriving) v9 B; ~6 b0 i! V3 [' F% a% A
    if A_induct=1 then clone 1 load to P_pick1
) A7 {, Z) r- |- n# w    else if A_induct=2 then clone 1 load to P_pick2
# t  X5 {# X/ \* ]/ ^/ _        else clone 1 load to P_pick3
  ]: I4 D0 R3 L, ~7 L' Oend
' }( V  Q& \, Y5 ?# t* V4 p) B( ?  I% u( ?* l; o
begin P_pick1 arriving
- T4 L! N4 @' y' I: p6 P    set A_i to 14 t: l6 ?+ B2 t8 }5 X
    move into Q_induct1
0 D% h3 y+ j) N$ M1 Q- m    move into pickaisle.induct1) G& S- B" G8 G# N
    while A_i<=30 do begin" ~0 B& [# v: r. ?) b7 |
        travel to pickaisle.con(A_i)% n+ I8 [& e' Z0 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 V# v7 K$ A8 m) y
        else wait for 10 sec) N; j  @+ f# |3 P4 o/ K
        if A_i=A_leave then send to die! T6 M. J! Z. ~4 S2 c7 J
        else inc A_i by 1
* i, i" N% L# G& v" t' p    end2 j& x  j# A7 A7 [" m# g
end
: s7 e$ \" B" {8 T5 T
( o9 e/ ?( H! B% n. ]1 a# {% pbegin P_pick2 arriving
# ]7 z) j  W& t' f9 N- {. w. v    set A_i to 11
+ [1 Z& d; G# V, V. X; F! o8 M    move into Q_induct28 ^% U: ]7 M: |; j9 e
    move into pickaisle.induct20 n) U! c/ I' Z( P! |$ e  [
    while A_i<=30 do begin
0 d0 i2 H1 f( v. B  K* w% |  j) Q        travel to pickaisle.con(A_i)& g+ y; V6 P6 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 a7 k/ \9 P+ }! Q' z, Y% n        else wait for 10 sec
, Q# ?: V" a0 y4 u        if A_i=A_leave then send to die' j) {; s* y; O' U
        else inc A_i by 1
# n  I0 a/ o1 u4 v8 P    end5 B/ V1 l: O: Q) c' p% c9 @
end$ O' Q5 E( P4 R" b$ ?5 F
9 m; ?+ Y% o' i9 R$ Q
begin P_pick3 arriving
4 q5 b& o/ C( F    set A_i to 218 |) n: F$ \9 ^  d; u
    move into Q_induct3) a: ^+ F3 a* i+ w2 M# F' q
    move into pickaisle.induct3
( S( O0 l9 z- Q. H  h; E2 a. g8 R5 B    while A_i<=30 do begin
7 l& t% n2 H3 ^$ N" k0 M$ B        travel to pickaisle.con(A_i)
& F0 u/ u6 Z2 _2 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 h  T- |/ J- ~% P* o
        else wait for 10 sec
  k/ `7 ]' D8 Z% N% [% A+ H        if A_i=A_leave then send to die9 c% ]7 }; ]7 g: _9 Z- B
        else inc A_i by 1
0 c+ t" }2 f, U( M1 L8 R    end2 Y" b& K0 K! o: ^, X
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是个什么东东?
: x: V) \. @3 N' \move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 h1 ~$ t' ]1 i1 Q: j4 O; W* w
- \5 [7 Q4 H; \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* d/ W! D: @. I0 C8 V, i
0 G4 p5 D3 D" m1 ^9 P4 U1 {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" S0 O" J) U$ m0 {0 ~: i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) i+ T/ P6 p, e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 @" s" G4 F+ W4 U' Y: U$ X3 R  j7 W! M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) M' V$ Q8 Z: X- i- K# L: J" K, v* ubegin P_induction arriving& N# x$ U( s, n0 Y3 W2 v
    clone 1 load to P_pick(A_induct)
( \# }( n" j, }& l6 o: l: C& aend最大的系3 ^' u( A7 |! [; K7 n% A/ {
& d; z2 e4 v* k  V" ?9 p7 y" d
begin P_pick arriving
6 ~& |" n# x1 w! W& z; U$ R0 _    set A_i to procindex * 10 + 1
, @8 L( V' z, |    move into Q_induct(procindex)
2 O- j& C9 D* t# r    move into pickaisle.induct(procindex)4 W# _. J# ?: \" w
    /*check the type of pickaisle.induct(i), for your last problem.*/
) A  g1 P, b9 {0 B6 Y" M2 i# _$ U! g" s. ?4 V7 l
    while A_i<=30 do begin
3 P  Y- I7 f! [        travel to pickaisle.con(A_i)
- s/ [: w" K5 q, w  S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Z5 Q  {  V( i. Q( G- c# k3 S        else wait for 10 sec3 c4 {, M( ^! M1 I5 [
        if A_i=A_leave then send to die
' ^+ v  Z7 F& {1 v4 f        else inc A_i by 1
) t. W- a8 f$ ~: A( {! O    end
8 k6 {' X0 c# T( H3 @end
$ M, i0 }! k& t. g' Z* r! A& w. ^  E( \: m: ?7 K
其中的procindex为整形,代表当前process的序号。
# k, q& V/ V2 [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-11 05:22 , Processed in 0.016194 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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