设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15009|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) o% G- _( e" B6 m7 C; b) ?
+ _7 T# @' Y+ a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% i$ D& X1 f; ?

3 S. r! [* C2 I$ b! A! e* B- jbegin P_read arriving* A% I. ^6 M7 c/ ]  z+ w
    while 1=1 do begin; c$ P6 k# H2 R, d+ s# `3 y2 z" A
        read A_tote from "data.txt" with delimiter "\n"
3 b/ h( p# i: w; }7 A+ q( o        read A_time from "data.txt" with delimiter "\n": H& H- |4 x5 J) u& X' `. V
        read A_leave from "data.txt" with delimiter "\n"
3 G5 ^' W- A: H        read A_picks from "data.txt" with delimiter "\n"$ I/ z2 q& E/ Y: ^/ ?0 K- j
        set load type to A_tote9 }- T& H' C4 Y" q0 u
        if A_tote="tote 1" then set A_induct to 1
1 {- x; E' A/ Y- |3 l5 M        else if A_tote="tote 2" then set A_induct to 2$ J+ W! Q* c4 t4 c) }1 y% ?! N! h
            else set A_induct to 3    ' ^/ O; F$ c% K! F3 d/ t
        set A_i to 0% s* K; d* R( l. w3 w9 P
        clone 1 load to P_induction0 s" f0 m7 R3 T4 d; ?+ y& o$ t6 ]& b
        wait for A_time sec: L- {7 n' s4 e6 X; ?
    end
- M7 [# n5 r& b# P- g7 zend9 R' O7 y! F* I% l# B

+ Y# {$ Q2 O8 j1 Y0 G$ F- D& ibegin P_induction arriving$ n" R8 n' K/ q; P3 _  H
    if A_induct=1 then clone 1 load to P_pick1' l# @6 f& A; P1 F/ r* \( v
    else if A_induct=2 then clone 1 load to P_pick2+ z7 ~4 q# I; _+ d: {
        else clone 1 load to P_pick3
# h# Z: n; q$ D1 E3 c& c1 g2 Qend: ^, ~6 q: a) q, H

3 Z% W! S% }) j0 T0 G5 Gbegin P_pick1 arriving
1 V- Y- c9 l3 G. G; y: o" h( i+ E( `    set A_i to 1
' t* l) w' W8 {6 R) ^    move into Q_induct1
& y% A6 r0 u# _1 b3 d/ q    move into pickaisle.induct1
2 G7 P0 Q5 Y( u" h( c    while A_i<=30 do begin
( E( y+ E7 ~3 l; Y6 `        travel to pickaisle.con(A_i)
+ s! c+ |: f$ r- Q. j) W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 V" i1 W. o6 F: W" _( J        else wait for 10 sec
/ `  @7 \: k+ p  w3 O        if A_i=A_leave then send to die6 n) x" V0 }: X" N+ Z0 x
        else inc A_i by 12 _1 w8 P7 V: A9 b
    end
9 E1 |! P4 n5 Q- J4 K0 [end( j8 {. p( O" v/ e' x& W/ c

7 D/ z. `; g* S/ a8 dbegin P_pick2 arriving0 i" w7 z% _! ^/ i3 r, `, ]
    set A_i to 11
& ~2 g; U4 a$ }# s. }0 y    move into Q_induct26 U  W# b9 j8 u* b7 O% N6 R
    move into pickaisle.induct23 ~3 y( o9 G/ e- e; h( v1 e9 _
    while A_i<=30 do begin+ k5 F6 j! C; _
        travel to pickaisle.con(A_i)1 U9 [8 u- R' V$ m% O2 w  Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Z2 w* A  m& C
        else wait for 10 sec
' K2 V; a2 X% T        if A_i=A_leave then send to die
+ |1 e+ K, S+ r7 V5 r% S        else inc A_i by 1: I; o  i( i. s6 K* R
    end
; h6 _  t7 }# Q0 e6 Z9 tend: {" Z( ~6 h7 E  {. M* L* F, m  X
/ R; B/ D3 q- F: v. \$ l) `
begin P_pick3 arriving
% W' {3 s, ?; f3 A    set A_i to 21
* B% A  n" d0 M    move into Q_induct3
2 s( j3 @. [+ s+ N* d    move into pickaisle.induct3( C  `0 e. ~1 _5 [
    while A_i<=30 do begin
  f, H) e' r! T9 b1 F$ N        travel to pickaisle.con(A_i)9 w- z+ m* d9 S; T5 K$ H7 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 F& X" ~& p9 j# f7 W+ L7 k! G        else wait for 10 sec
1 ~8 ~' Z# V) ?. z4 ~: t9 w4 z        if A_i=A_leave then send to die# V+ V3 x- K$ q3 m% Z* R
        else inc A_i by 1
) Z1 a6 f# e5 f) c    end$ o9 j5 I! S* e6 ^
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是个什么东东?6 k: O6 D1 R1 F" C+ T0 H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ b) L" |$ n* h% U9 L# x5 [9 G& f/ K; \9 D* s% j
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; r8 W2 j$ G! ^& C/ `- ~

) ]: r- D: M) c4 c% O7 q1 S5 n6 I  ^. Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 \# x: R1 ~9 a0 {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ `/ ~. c4 y& b, A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) G4 [) h+ u% c1 z& w- O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' Y7 w8 G( p- B  P# z4 s
begin P_induction arriving2 ?- O5 U1 }) B( R
    clone 1 load to P_pick(A_induct): q! _; [1 T  q4 W! P3 M! [$ ^0 N/ b
end最大的系
" S3 X+ `) B& Z: o3 Y- p' Q/ D! ~9 x( p# k7 w
begin P_pick arriving
, y: u. w; W5 {+ N    set A_i to procindex * 10 + 1# i1 p. ^. [1 D! n
    move into Q_induct(procindex)
" e5 ^- T+ x" a& n    move into pickaisle.induct(procindex)
9 k2 U9 j! u% B" M$ o    /*check the type of pickaisle.induct(i), for your last problem.*/
  c8 K2 @. _- h+ D3 H  l
+ c5 Q! U! M) G) [+ h! @0 b& |    while A_i<=30 do begin
/ L; Y( O' r( L& n% H: K        travel to pickaisle.con(A_i)% o8 y: }6 r0 O, F- v7 F" J) y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 Q( N; b1 @; O        else wait for 10 sec
2 w" v3 I0 j% ~' U        if A_i=A_leave then send to die2 K) w5 b* ?) e- d- o
        else inc A_i by 1; K/ E2 L' `  G5 C1 M
    end1 P; P6 B9 D- V. D& ?
end
( ^1 g1 J0 l# w3 D( e
3 y( c  ~! g8 X. l8 Z  @9 g: r& k$ [% K其中的procindex为整形,代表当前process的序号。
9 u; d6 o7 G8 `0 d4 d0 g: P) b7 Bstation和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-8-4 00:24 , Processed in 0.019050 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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