设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13032|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  I* V. d* j" r2 b" }

  s5 R9 c& Y9 f" u9 x# ]. v我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& u8 y; }5 s4 i* c" N9 B* I
. Q! e7 V* ~7 z" ebegin P_read arriving+ q- T+ k$ ]0 W" r% f. g
    while 1=1 do begin# p7 |' k" F, [# k0 _
        read A_tote from "data.txt" with delimiter "\n". n! c! j# }+ {- ~5 K1 w5 Q
        read A_time from "data.txt" with delimiter "\n"
2 K) H0 g1 g  b% @, h        read A_leave from "data.txt" with delimiter "\n". v* K8 o  }9 V% t( ~8 V; y) l
        read A_picks from "data.txt" with delimiter "\n". d2 A0 z( |  T
        set load type to A_tote+ K" K5 u  l5 S+ c" j
        if A_tote="tote 1" then set A_induct to 1- p) P* {- M4 }/ N% v2 V! R
        else if A_tote="tote 2" then set A_induct to 29 j1 O- O* C6 f% P- h
            else set A_induct to 3   
$ n8 U1 z0 D5 p        set A_i to 06 u% y: o5 b5 f' U5 `  R
        clone 1 load to P_induction" Q, H+ m( s8 G$ p9 A# @7 }
        wait for A_time sec4 a7 k  d; `3 F
    end
9 S6 y: J$ Q" M& Q' vend
& G+ t* l" E, g& |8 Z, R4 c1 ^7 N" F$ o  a
begin P_induction arriving
  |1 w. `1 F" B7 m    if A_induct=1 then clone 1 load to P_pick1
& k3 N( o3 F! Z& F! r1 T! ^6 ?    else if A_induct=2 then clone 1 load to P_pick2* A( s& F: ]/ {. O
        else clone 1 load to P_pick3/ f* @. J& u8 N7 `, _- g7 M) [, z# g, k
end5 s; ]7 R8 m$ T5 ^) H8 l: \

6 \, F, V  ]  b5 c; o- e, f, ibegin P_pick1 arriving) q2 H8 k! \6 P" O* k9 b/ L6 N3 _
    set A_i to 10 z, Z3 D" o1 \) u$ H
    move into Q_induct13 \/ G6 t7 A0 D
    move into pickaisle.induct13 S" D9 ]; P5 v" ~# {
    while A_i<=30 do begin' o- m, G( X  [8 |8 H* H( [+ U
        travel to pickaisle.con(A_i)* a4 X" E7 |; g! u" j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ]2 `/ u: n- X. I' M& w" V
        else wait for 10 sec" e, Z- q  q+ O
        if A_i=A_leave then send to die
6 g  o- r! S$ V! D& H        else inc A_i by 1
2 m, M( S- @+ Z    end6 j! N4 y  F/ }. d6 F
end% V% Z6 p! C' B' U: Q# l3 G- K
0 j3 ]# v5 B" j2 N5 Q; v4 l5 N
begin P_pick2 arriving
/ n; V! O$ V2 m    set A_i to 11. \9 \0 L5 c4 |: I$ E
    move into Q_induct2
1 u! R! q, L. z1 i0 B0 y' o8 r( Y    move into pickaisle.induct2) G' q3 u4 L8 ?$ |: u# b
    while A_i<=30 do begin$ |$ S1 Q$ a4 Q3 O
        travel to pickaisle.con(A_i)3 H4 _9 i3 [) G3 `( L4 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 R8 P( n9 ]4 N7 f# R: _
        else wait for 10 sec
. Z1 Q- E$ w7 r; u& p        if A_i=A_leave then send to die# p  A+ F! Z2 \( S
        else inc A_i by 10 y4 O! m: y. I4 N7 v+ J
    end
/ ^, l6 ]: ?, V) l" ^; pend
  [7 |  y$ U, ~' F6 a9 w6 E' g) m5 F: o: |" O1 y
begin P_pick3 arriving6 p9 K  \; M6 ^# L
    set A_i to 21: a  p1 ~1 {' k1 c
    move into Q_induct35 _* j9 h8 H, n8 {
    move into pickaisle.induct3
5 b7 M0 ?& w% E4 y' L( H& v    while A_i<=30 do begin$ s' h/ \2 g8 k5 v% X# r# c
        travel to pickaisle.con(A_i)
9 y- L7 p* S. R) u' H  M! a& _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; B  }# q0 p8 [3 j
        else wait for 10 sec
4 X9 _- G/ c! u% K3 R$ e  i        if A_i=A_leave then send to die8 D: b. Q# O% u5 V! E
        else inc A_i by 1
. n0 B6 ^5 L) r1 g7 s  `    end6 v9 T& T; W# o% C/ |( T: U% ]
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是个什么东东?, @- R0 m8 B( F8 Z$ w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 ]  [2 r! V; V( z- h
4 }  v. s7 {4 J9 c8 A0 mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# C4 B; [6 t; d. c" i

8 @+ E. x3 ]$ D& @" B" k' N* m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ p# j1 |& l% ~5 l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# g+ d5 M  ~- X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ T  J# S1 E+ s: e. u; t2 S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 e3 T: d1 |6 e7 d0 O1 L0 _% g6 x9 n
begin P_induction arriving4 x4 Q  i0 J3 n$ l( x) A+ w
    clone 1 load to P_pick(A_induct)
5 M% z! l0 h0 [+ l/ ]9 fend最大的系. F# c$ b* I% \  V# L( J9 j. n

2 w: a+ l7 J) n5 e& D$ f4 J  m0 D. Xbegin P_pick arriving( J6 F) \$ P* x+ O6 A" {! f) W
    set A_i to procindex * 10 + 10 r4 t0 a1 [# F
    move into Q_induct(procindex), r- l& n# |. N; N: H
    move into pickaisle.induct(procindex)) ~- f; \6 }' e( e% g# O' N
    /*check the type of pickaisle.induct(i), for your last problem.*/2 E9 g( ]4 [( g% L- A( U+ p; v

+ t' a$ B6 T) U/ J* I0 V/ L, n    while A_i<=30 do begin/ ~: O9 T% {9 B9 U( T8 S1 A
        travel to pickaisle.con(A_i)
. K9 M" a5 z9 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 y9 m6 I  D* [7 P  M: S        else wait for 10 sec( a2 f4 D/ V( H+ ~" J
        if A_i=A_leave then send to die0 I6 U) h$ H8 U5 x8 N
        else inc A_i by 16 n! C' V& }; Z4 Z- p5 e# l
    end
2 f% M, O" a4 d7 m* |- b  Hend
( F! W, \8 p$ L: @9 N4 R* A9 R+ E/ n! C
其中的procindex为整形,代表当前process的序号。! d+ x  V- B! D( T% \
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-3-12 18:50 , Processed in 0.020251 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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