设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13713|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& Z: `; O1 d* j, q1 d0 G# R* l; e$ z- a! X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 `' x% A$ w' o
) ~4 p- P; p1 u% U% b8 E/ ]6 @/ X- Obegin P_read arriving
# S- c5 @; I0 H# A% ?" {    while 1=1 do begin
2 H3 n- x9 S2 c2 B$ ~! u: E        read A_tote from "data.txt" with delimiter "\n"4 M$ m( u6 f$ i: N* v
        read A_time from "data.txt" with delimiter "\n"# T* k& a+ v: m) @- S5 Z
        read A_leave from "data.txt" with delimiter "\n": p8 X6 k& x, x* f3 X  k# P  y) a
        read A_picks from "data.txt" with delimiter "\n"% h2 J+ c# `: w) I
        set load type to A_tote  H1 o- P% w/ M" G# D
        if A_tote="tote 1" then set A_induct to 1
9 h9 W8 d; F  Y; Q! z        else if A_tote="tote 2" then set A_induct to 2! q! H0 M, q& v% O' s
            else set A_induct to 3   
; x- ?7 S5 y0 v( W        set A_i to 0
  z* u2 w) w( s. P        clone 1 load to P_induction
$ K" d/ g4 L+ D# ]* L        wait for A_time sec' [2 @+ n0 k  K5 ~0 C, X
    end' ^1 d% F- A- l" @3 O9 n) z* A
end3 y! E1 B9 ^7 g0 b2 r5 }& a

3 O. o6 x" g6 x8 Nbegin P_induction arriving
$ ^: {' l# e1 P* u9 U. a5 L* W    if A_induct=1 then clone 1 load to P_pick15 H3 ~- ^( H9 D7 l( H3 M: F
    else if A_induct=2 then clone 1 load to P_pick2- k1 l: o& {4 F  Y  ]5 B* \; R
        else clone 1 load to P_pick3
8 {9 |; g" V7 y4 P- Send  y* Q, A, @5 C! E/ P+ U

' B! F: |# c6 p2 W& nbegin P_pick1 arriving4 N1 \' D2 R6 a0 l, Y
    set A_i to 1
! _  {. v1 k. g  x    move into Q_induct1
+ p, |4 q. C% Z: w! n. [3 X/ f    move into pickaisle.induct1( y1 D& d& R9 p$ X7 ^, W9 \( x
    while A_i<=30 do begin8 r/ R9 y% C( M1 j
        travel to pickaisle.con(A_i)
: C/ u( c2 j( {& O+ @( Z. Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 V& k7 D# ?0 I. t" D, f& m, j        else wait for 10 sec
) m8 t6 o8 H6 U% X2 K. G        if A_i=A_leave then send to die
# L; z( g; ?: J        else inc A_i by 10 Q- s& ]  r1 ~: S5 t5 w
    end
6 ^" N" @( }7 i0 Xend
0 G4 h/ F1 R9 o3 s
! e! I3 W3 N8 v- y: f- D7 pbegin P_pick2 arriving, V# ~, A! w" S' Q$ K; l
    set A_i to 113 z7 A# e1 ]7 {
    move into Q_induct2
* b; \, c7 Y' j2 Y+ [/ O    move into pickaisle.induct2, ^& G6 D# A* A# N/ \; S
    while A_i<=30 do begin0 Z9 `$ l! {: Z& R$ z
        travel to pickaisle.con(A_i)
: v$ `2 o% s& ?8 H2 n3 f4 C+ n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" N- c" B2 v" t7 d$ I. v; J. E9 n        else wait for 10 sec$ W5 X. ]+ ]+ J1 x8 d
        if A_i=A_leave then send to die* m" @$ s- ^& l5 r( C
        else inc A_i by 1
# i4 l1 o" z- m' M4 a0 D8 O    end$ F  e% t2 _2 q/ ?8 y" ]8 Y
end& g6 B8 e5 c: \
1 [3 I0 `. \- r6 ~- e
begin P_pick3 arriving
; w% f- O" N/ S9 ?$ j    set A_i to 21& l2 y- T' A* M0 `- i: L( |
    move into Q_induct37 \3 Y% O6 E0 g9 }; M
    move into pickaisle.induct3
& @" R2 _$ R) p/ t    while A_i<=30 do begin
& z/ F3 o, I, _. W( q1 \% W7 Y        travel to pickaisle.con(A_i)
6 G* W& f$ W/ i4 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# g( V+ `! |9 y7 [8 E) T" l0 |        else wait for 10 sec
8 p! k  b$ Z$ t# H3 J5 R! K        if A_i=A_leave then send to die
! q$ Z+ g3 j- n+ G% `6 D        else inc A_i by 1
, y( R; Q5 H; s9 t5 q# A% h" l    end" _' S% f; A! x; Z4 h
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是个什么东东?
+ b" h8 u, u* X: H5 ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" O. h% d4 @& w# I- y  y, Q% o9 N

2 a* S6 z0 F, D$ ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ ^  u* W4 i! f& d

- E8 y# p1 D/ Z! }. W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) O( V; _& G3 m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" G; w" Y8 d. r  j2 {. W2 @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" `9 L: @6 M4 `+ |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 B) j; g% v( I+ E" O
begin P_induction arriving& G7 h8 P, k1 S0 X
    clone 1 load to P_pick(A_induct)
4 }, A- G; N# _0 Yend最大的系
5 }0 \& c/ w7 T2 l
- U9 L  m# }& b( R: J: c9 m: }0 ebegin P_pick arriving
' e# k2 D/ p: F4 ]: A    set A_i to procindex * 10 + 1) @4 }( ~: c( K' p
    move into Q_induct(procindex)- O  r0 f' O) f4 S6 q8 o
    move into pickaisle.induct(procindex)& D7 \4 h7 y" R7 M4 e: S/ Z
    /*check the type of pickaisle.induct(i), for your last problem.*/6 }" h6 o9 B$ y; `, `8 [' y9 Q: C6 @
+ R& ?; u" E6 U! Q' S5 Z, C
    while A_i<=30 do begin
8 ?7 E+ X" u. [1 s# u        travel to pickaisle.con(A_i)
6 n5 R- J$ Q1 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: d  m/ T6 ^# M0 _+ ?' z, o5 b        else wait for 10 sec- ?9 r% l3 r, l0 b+ D; O2 N
        if A_i=A_leave then send to die" P7 v6 N6 _& Z. q4 y, y
        else inc A_i by 1
0 u1 U4 i( y- u+ E5 H1 m8 O    end) d8 W% F) \4 X1 _1 I5 s
end6 }+ h! q4 q8 I$ I6 E
5 u2 M" l0 V+ i$ T3 K
其中的procindex为整形,代表当前process的序号。( B# i" |4 [$ O; J, [/ U9 ^
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-4-30 12:57 , Processed in 0.018270 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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