设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14835|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- m) P4 ]. V" F. S
1 D/ ?6 s- ]" _) Z9 x: 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中的数值,不知道会不会有什么不妥。8 Y+ x+ K" K4 n# D" |

) c: N% @2 s% R- e% n3 W3 xbegin P_read arriving3 w% g" ^& j5 J# K" K
    while 1=1 do begin
$ J3 T. B0 A6 k& [* [        read A_tote from "data.txt" with delimiter "\n"+ o  Y; c6 k9 t4 s9 Y  b$ L: R4 Q
        read A_time from "data.txt" with delimiter "\n"
, m- j/ ]2 x5 B: }* f7 n" W        read A_leave from "data.txt" with delimiter "\n"4 j  f% w2 V- c/ V3 p$ S
        read A_picks from "data.txt" with delimiter "\n"
9 Y9 A( |3 Y+ L5 Z+ Q1 q; i        set load type to A_tote* [$ G( u& l8 X# k, R) n
        if A_tote="tote 1" then set A_induct to 1% p" |5 @$ k3 f/ |$ b
        else if A_tote="tote 2" then set A_induct to 20 Z) P0 c( |! y' g6 B. e$ {3 E+ d
            else set A_induct to 3   
" K6 y, a0 L+ J3 T3 Y1 H+ k5 G7 X        set A_i to 0. w  w9 c$ R5 X' H9 }3 i
        clone 1 load to P_induction3 Q6 m3 @; F/ N& J
        wait for A_time sec
. ?5 x' ~* _4 p9 b: S" f& N' j1 V    end
" {4 E- m: `3 N7 I3 iend
* _8 E, j! f0 c4 `. K" s+ N0 d8 u: ], r$ \" a, f
begin P_induction arriving; V( G, y& l' o. \
    if A_induct=1 then clone 1 load to P_pick1+ B5 {9 m, f$ }) c  p& _
    else if A_induct=2 then clone 1 load to P_pick2
; F  h2 [, h4 X# X/ ~* I5 v        else clone 1 load to P_pick33 q( k2 U  t0 ^$ ~0 Y0 ]6 F
end$ j4 l# a1 l) Z0 d" N. y

- w/ }1 S- X* h/ Ubegin P_pick1 arriving* U1 {. h# b/ O: r5 d
    set A_i to 1/ \& u3 i4 B: K( w9 }/ R" s
    move into Q_induct1
4 T  z7 Q" p# u1 D* a    move into pickaisle.induct1& c, i, b8 u' ^) q1 u
    while A_i<=30 do begin" J# u9 c8 k) u1 E2 t  G
        travel to pickaisle.con(A_i)
7 B7 @; S! _5 {5 E0 v" m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, E4 _" T; j$ [9 f9 v1 r0 Q
        else wait for 10 sec
2 w+ g0 I( W' J' E9 ?4 d* K        if A_i=A_leave then send to die% \  U% l  O6 i
        else inc A_i by 1
7 O, Y# c- s) k8 D    end
/ b- L% o9 s0 @5 _" {' Gend0 d' f& ^0 W3 d5 v' y  ]& Z
  R! o4 E/ G: w1 z6 ^3 h
begin P_pick2 arriving3 H) K/ v- ^5 i$ x' u
    set A_i to 11
, d2 L) S4 Z$ Q& a5 ]7 f    move into Q_induct2
" t9 K: K# p6 ?9 P: M( I5 R    move into pickaisle.induct2% p% y. k( R+ K  Z/ ?
    while A_i<=30 do begin
& V" v' s# Z  L' w. }( Y        travel to pickaisle.con(A_i)
) m* {- i7 J0 _& k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 {/ Y1 y8 \, H        else wait for 10 sec
7 `( c5 O' W9 H/ U' @0 C. |        if A_i=A_leave then send to die
0 o! }& X9 A& c( w3 a4 X        else inc A_i by 1
' ~4 {8 l. D( G* ^5 i7 p) X( z" [. F/ ^    end
/ ]& ]. \2 |1 p$ Q3 y1 g. ~+ A# Yend! V, `1 }! q# k. I; F) S4 b

, k0 a+ ^5 Q$ {3 u8 ?begin P_pick3 arriving- {- ]6 |$ `  t4 g& u4 j8 P. Y$ [
    set A_i to 21
! S2 s7 Q$ d$ h4 o    move into Q_induct3+ S+ ]5 S/ W# R8 q# N5 ?
    move into pickaisle.induct3
, u8 e' N3 R- K" W    while A_i<=30 do begin, H2 X$ v4 o- d, J+ p* G4 C
        travel to pickaisle.con(A_i)6 c" x4 ?# R" }1 V% y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 j% B  Q2 u8 p" M0 d& l) y        else wait for 10 sec
9 m8 j( [9 U$ A        if A_i=A_leave then send to die2 @8 z/ h1 n5 I) `# x
        else inc A_i by 1
- Q9 \7 M1 M+ Z8 g: M% p6 }' E" _    end8 r1 I+ ~. [) y" F
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是个什么东东?* Z/ _) b7 S8 a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, E% d) [6 @; D6 R4 J2 e8 z/ b: W, m2 w2 F7 p7 R* C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 x( q0 H2 |* g5 h5 P+ j
6 p3 V, I% C1 g1 A1 g" h$ M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' n( A; _1 ~7 T. G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# B# P8 Q) s0 Q) x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! k# N2 w) v  g6 |: E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 I1 Q" W6 [! y8 ~+ K
begin P_induction arriving$ j: K& _! [; ?4 w, C: T) v
    clone 1 load to P_pick(A_induct)$ S" D9 w, Q) o
end最大的系3 s. q& b% Q$ B% x: V" y; u) K
$ h0 ^& Z% O( `) B
begin P_pick arriving2 P* G: S9 \8 `; O5 G
    set A_i to procindex * 10 + 1- o" R: o0 A7 ^" Z2 F6 U% G& ]) {# {
    move into Q_induct(procindex)! {# @& F3 W1 Y0 P5 g. _9 X. G/ p
    move into pickaisle.induct(procindex)
; ^9 `0 [: }1 S/ b  S/ `5 P4 L    /*check the type of pickaisle.induct(i), for your last problem.*/
( H) w, y, P  w
4 w) a+ Q5 S8 v0 q; W" \    while A_i<=30 do begin+ d% K# o0 a* x0 |
        travel to pickaisle.con(A_i)
/ B0 a& j+ g: ^. Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ^: l8 C& I3 l5 r* J6 P/ W! v
        else wait for 10 sec
3 ^2 S8 w" k1 i2 v& {5 T3 Z        if A_i=A_leave then send to die
  T: m7 ]: Y% R+ v& |7 L0 J+ X        else inc A_i by 1
4 A) E$ m. [) [. @. Z7 C( W    end6 Z' d. h# J8 }! `4 j: v
end1 S( `+ l/ ?6 x0 A

7 i( b! m8 v+ s+ D其中的procindex为整形,代表当前process的序号。
# N, j; S1 a" y( W" B5 N+ lstation和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-7-28 15:00 , Processed in 0.016040 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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