设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15150|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ |- v. B8 ?9 U. Y  m
' J8 u1 \5 Q1 _" s& c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, Y! z+ t! E9 [: a* h4 i
# {" r5 o4 [3 @! z, Rbegin P_read arriving( R, j' ~7 ]' ^8 v6 L& y. i
    while 1=1 do begin
* ^. L2 D# g8 ?- w; ~+ j0 x        read A_tote from "data.txt" with delimiter "\n"
9 F9 m& J, Z/ g) H        read A_time from "data.txt" with delimiter "\n"* E/ ^: B' i6 k6 ?
        read A_leave from "data.txt" with delimiter "\n"+ {. {; D6 N/ O  z  F4 H! [5 V- i& g
        read A_picks from "data.txt" with delimiter "\n"
6 u; X* D/ j* E0 z4 E        set load type to A_tote$ A' F( F2 U  [# ~! Z4 ?: Y
        if A_tote="tote 1" then set A_induct to 1
$ D6 J3 w. ~6 n' n9 j  d        else if A_tote="tote 2" then set A_induct to 2) y- {0 e$ R6 W; |9 @
            else set A_induct to 3   
# s' D/ V& J  k( O1 {# O9 t        set A_i to 0! }- @& u( A0 U7 \! H1 Y
        clone 1 load to P_induction: i5 E6 a# M9 _6 U
        wait for A_time sec# P- o* G4 _9 s! n; `
    end
% R8 d. @3 m# m8 Aend- H+ x4 B  ^  c
! O6 ]3 |+ I% I" ?& Y* d: p9 e
begin P_induction arriving
4 z; t! e8 F' i4 i" k$ R2 n2 {    if A_induct=1 then clone 1 load to P_pick1. T7 z8 y$ G6 @
    else if A_induct=2 then clone 1 load to P_pick2
4 ]3 B# U7 ^% {  I        else clone 1 load to P_pick3
: p, s  D8 _: A. X+ Xend) _/ j. s0 b/ N9 Z
& z& G* C& O/ d8 {) H9 o
begin P_pick1 arriving
' V$ k) o- r6 w7 R0 V; {    set A_i to 1
/ Q! X! F2 v0 Y, ]1 q4 S# \7 A) Q. z    move into Q_induct1
. I( n! ?* ~) O$ x- F8 m    move into pickaisle.induct17 u' J: o1 F5 ?+ r& C( ?# |
    while A_i<=30 do begin
$ T" T/ p7 s9 `+ M: m        travel to pickaisle.con(A_i)
; w/ |6 t# ?0 I  p) U! q3 R2 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 @  B# W  X  A1 m7 |
        else wait for 10 sec9 m" ?1 M) {  i) V6 O* g1 I- `, R
        if A_i=A_leave then send to die
2 }& @8 P" ]$ y" c7 H9 T) ?- G        else inc A_i by 1
; b- Z7 S- _1 w    end+ [/ _3 h, ?0 w" S; _
end/ k. ]& ]$ p4 a5 R
' W+ W1 i( O2 A5 |6 Q1 Q
begin P_pick2 arriving9 F7 ~! h: N9 W* O! z2 `
    set A_i to 11( ~8 |; x8 e8 S4 ?* w1 ?# B! J
    move into Q_induct2
- K- Q2 O% r8 ^) g+ g* s8 @. J    move into pickaisle.induct20 b' X# U" Y" }) x4 V
    while A_i<=30 do begin8 b7 `5 z* N- R1 J7 X4 j7 ]
        travel to pickaisle.con(A_i)
3 X6 [( Q! b! u6 r& E. s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 k; x; i3 z# C9 ]* v! ]        else wait for 10 sec+ C( L. I9 c" {9 ~( `
        if A_i=A_leave then send to die6 ^4 {. T2 p9 a. D& J' r3 ~
        else inc A_i by 1
+ O$ e2 P% I, r) H: O1 V7 P; _    end
5 N4 w# [5 }$ w' q2 E: zend
  |' U6 W* Z  D& G
( q- j5 [& y0 F( [begin P_pick3 arriving
; @( C/ h. T6 G% k2 ^  k    set A_i to 21; ~* p2 C( K6 s3 L. u8 v
    move into Q_induct34 t$ d% x3 ^; a- t
    move into pickaisle.induct3, u& l: r- v$ I, S4 k. Z  [
    while A_i<=30 do begin+ g2 h6 w& ]% Q" t. s0 j7 j1 `
        travel to pickaisle.con(A_i)$ C' z- ~' V. w: h0 z2 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! T. ^! X0 I$ ]- T
        else wait for 10 sec! M' d% g% W' j% I( y8 H
        if A_i=A_leave then send to die5 X3 ?0 ^6 |; l7 G' O
        else inc A_i by 1
3 c# @# ]! g0 n  z" J5 f    end
2 j% e$ n4 F: S# l6 c7 I  O* ^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是个什么东东?) I3 e( A5 Q# N: U# w+ n2 T. B6 w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# x; ]* ^; m. \2 a" |* D6 T
9 k5 r# u; Q6 J" _$ e& ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- x1 P- I3 A4 c9 I. n! k! |5 i
3 \; _$ F* _, K  B" z  v1 \% e7 I2 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' q! M1 q1 I; Q9 T4 z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( o% H: \8 Z9 I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 Q: N/ y) i6 I  ~" P7 r1 ]! s% D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! j+ ], @' o( P6 c1 a8 p
begin P_induction arriving
! x) R( Q/ z% i2 [* w+ X* O) D2 l0 E    clone 1 load to P_pick(A_induct)
. Z: Z( C# z- N4 c  |2 I; e( Aend最大的系
& B0 ?! Z  o( E: n, D& S; L) E, l5 B
begin P_pick arriving) c. }: A6 f7 w' d& g
    set A_i to procindex * 10 + 1" a  L2 h7 h* E9 ~0 ~3 _" i
    move into Q_induct(procindex)# l* o5 j5 Y7 A; W" X& P2 }0 o, ]
    move into pickaisle.induct(procindex)8 w1 G) r  X+ `; X
    /*check the type of pickaisle.induct(i), for your last problem.*/
. q8 e$ s% o3 ^* M9 Q+ ~4 W' C$ Z! ^- G
    while A_i<=30 do begin
0 s6 B+ ]; Z" a* Y: W3 W        travel to pickaisle.con(A_i)4 _+ I3 B. B# T. t7 _0 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i% Z" B  m# A# z3 F
        else wait for 10 sec
- T1 k, X2 ~9 ~        if A_i=A_leave then send to die8 m$ I) g7 A3 S. R
        else inc A_i by 1: G6 T& z. b0 i$ c5 o
    end
: D; J; a/ I. ~: Pend' V: E% \4 S7 C2 U" }* s1 r/ S' q

0 v7 n; u; ~- M" |7 p1 _3 j其中的procindex为整形,代表当前process的序号。% x6 Z  ~  p! J* Q$ O! f* Y
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-8-15 19:49 , Processed in 0.019651 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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