设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14281|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 Z' T# {/ ~% Y1 F( c
* ~; g8 I) B! H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  N( s  r6 X. W+ ?9 E

& h8 K) a7 D0 |5 o( vbegin P_read arriving
9 X4 s6 N. W) c4 b5 X3 Q    while 1=1 do begin& i" @/ E; m( H
        read A_tote from "data.txt" with delimiter "\n"$ E2 t8 H7 U: N7 P
        read A_time from "data.txt" with delimiter "\n"
1 C/ [: \+ L2 I  n+ ]9 @/ Y" z/ e        read A_leave from "data.txt" with delimiter "\n"
$ z! ?7 ^  c' f5 l1 @# T        read A_picks from "data.txt" with delimiter "\n"
, h- m+ H/ \3 }4 T7 G1 [        set load type to A_tote
5 {; o( i4 ~5 b' e1 l% H/ S        if A_tote="tote 1" then set A_induct to 13 ^; F" c' W' k) s
        else if A_tote="tote 2" then set A_induct to 2  L% f) f+ t' h: n
            else set A_induct to 3   
, k" s) r% e" {        set A_i to 07 Z3 Q. y6 c5 A" M. w% w
        clone 1 load to P_induction
' Z% V/ @9 K8 F- R        wait for A_time sec$ x/ `, F/ ?, o$ F; c6 d3 R
    end9 k$ \. J+ S* u! {: h' e
end- l# E$ _7 r/ r" B
) Q( ^& k' Z, J( e9 W; R. e6 I% g: ]
begin P_induction arriving! Z0 P$ _' Z" q1 J
    if A_induct=1 then clone 1 load to P_pick16 x4 S5 K7 F8 {* _
    else if A_induct=2 then clone 1 load to P_pick2- n8 F) r' l$ e0 q+ }
        else clone 1 load to P_pick3
( O4 ]/ h7 [( |/ Y8 [3 ?end
5 C) ^3 w2 V) i: S
2 \: o& [) P, g! O2 Pbegin P_pick1 arriving
$ j& n% P8 r4 O+ l! g- W. H1 l    set A_i to 1
* b# Z( c' U9 h' F3 _    move into Q_induct1: I: Q% c3 ?: U# X9 y
    move into pickaisle.induct1
5 Z7 n6 X+ y; h9 ~! F$ X: j, ^( t    while A_i<=30 do begin+ v  @: K4 @& m; R- j
        travel to pickaisle.con(A_i)% Q. z8 P: v: M& ]8 z" D, [( L) o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d" Y. N$ P! Z8 ]
        else wait for 10 sec) j2 g8 w) P# ~5 P9 H4 @4 g5 Z
        if A_i=A_leave then send to die. I- u* |# y  g, u+ n. ?. z( p
        else inc A_i by 1
' h4 n/ K* n6 t+ N! f. i    end
' ~$ z; j& F( V7 D4 send8 l: J! c3 {3 d1 C# R

0 }1 h" H8 ]6 m5 |% Cbegin P_pick2 arriving+ p( \9 e5 c! T+ t' g
    set A_i to 11
. v: z+ F: j. ^$ H9 \    move into Q_induct2
, H+ y! d8 o+ t1 F2 W+ g% P& g$ n    move into pickaisle.induct2
# _5 s+ r1 u9 \' h3 }4 E    while A_i<=30 do begin
  f2 C( i8 e7 F! i% s: k0 `0 _        travel to pickaisle.con(A_i)
" n5 h+ I# V9 Y* q  Z5 E! N! g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 o3 R9 Z/ A+ }3 [" Y: |8 \        else wait for 10 sec: L. P9 _$ l9 B. c% y6 z
        if A_i=A_leave then send to die
3 `6 ?& _8 E( Q7 S# }& k        else inc A_i by 1& @" o7 j0 `' j
    end
, r7 F" H' H1 o+ `. T  Kend
7 E. ]/ K8 W6 q+ W$ L; t* Q- B
5 G7 X# ?  ]1 s( s8 P. qbegin P_pick3 arriving; E# U5 P. f9 n2 N& J% p7 f
    set A_i to 21! Z% H6 X: l4 t8 S* o
    move into Q_induct3# N" b, x1 D# h3 t5 N) Y  S" ~* O& Q
    move into pickaisle.induct38 Q$ \9 [2 u" X/ g' e
    while A_i<=30 do begin# |5 v3 H1 b# {6 G2 p) j  \2 G
        travel to pickaisle.con(A_i)
3 y! o. K/ t% O  \3 T" {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 S% l" F. y# ^. w! b5 |
        else wait for 10 sec
* K; u* `7 g0 @! t( i: O8 d        if A_i=A_leave then send to die3 r- m7 C) z7 ^$ t9 `$ w5 N
        else inc A_i by 1
/ a  \3 r2 ~/ K8 e: s& `. b    end2 w5 D$ a, C' R0 Q  ^  @- `  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是个什么东东?  o1 g2 J1 u' e4 T
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" K8 ], p6 t# o5 Z" x  {
8 G" u/ H" t( q$ H& a  KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 a& p$ o/ u. K% @
, t3 ?/ @+ k6 N9 x% G: N
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 T% A% `9 A% c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 Q9 n' Y* U: ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 u) {" p. w* U% u: j+ c9 l3 }0 j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. Q& Q6 y8 Y6 \
begin P_induction arriving6 }" O% C7 d" q# t# x
    clone 1 load to P_pick(A_induct)8 y( V. U- d5 i( ?4 L
end最大的系
; J/ ?4 J6 Y- S7 Z; B$ r# B0 x) i" }  c
begin P_pick arriving
" M* [0 j4 a5 c+ C* I! Y. o    set A_i to procindex * 10 + 16 }2 m  J) D+ d; Z! C( n  ]$ I
    move into Q_induct(procindex)+ d4 _& M8 B  l  O
    move into pickaisle.induct(procindex); \. [( n" ?; c$ x; C
    /*check the type of pickaisle.induct(i), for your last problem.*/
  R! {: J" {9 o0 h' q$ q' N+ Q
/ e+ p2 t$ n( B- Q1 v    while A_i<=30 do begin
, ]7 ^; q# R) u& Y3 G, O        travel to pickaisle.con(A_i)
3 j( C5 B3 u: H+ \: h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ f7 y. [7 H# B& Q8 R9 F* i/ d        else wait for 10 sec- @( o5 J) d& q3 @% L
        if A_i=A_leave then send to die. |9 f6 l" z5 [5 P
        else inc A_i by 14 r! D3 r8 ~# s
    end
8 M0 _% M. \3 ?. S8 w2 Fend
7 F, P6 F( \3 u* m7 t
! j: h/ E  j3 y# \其中的procindex为整形,代表当前process的序号。: a' t) T- K. O/ d# S# O
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-6-27 22:24 , Processed in 5.637405 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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