设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14747|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# F5 `& [0 h( J' J
. c# s9 i7 z8 O- P* }. F: L  l我的问题是,在每个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中的数值,不知道会不会有什么不妥。! d6 T, t1 q4 S/ J8 C6 T

' S2 l9 B- q& t  C4 e3 a/ P$ Ebegin P_read arriving: o2 ]; E2 O; k0 t
    while 1=1 do begin2 V! V  N8 z2 v! @5 Q
        read A_tote from "data.txt" with delimiter "\n"
. {& d( r5 p+ G4 F        read A_time from "data.txt" with delimiter "\n"
0 _6 f& Y, V6 a' w% r8 X0 y6 L        read A_leave from "data.txt" with delimiter "\n"1 D& ~+ c( ^$ ?' A; q* i  O  q
        read A_picks from "data.txt" with delimiter "\n"
: u: P9 J  f+ u2 D" u7 F        set load type to A_tote
5 `5 `/ X2 u+ V" G8 D# f        if A_tote="tote 1" then set A_induct to 1
+ K* Z& \& f5 H8 O8 B        else if A_tote="tote 2" then set A_induct to 2  y, s0 {. u; U' k  ]1 X7 W$ S9 Y
            else set A_induct to 3    : \' n- {" l9 L; I# X4 `6 v
        set A_i to 0
" c. t3 \& n4 n        clone 1 load to P_induction! q6 v5 o5 @( a& e* M" J- ~
        wait for A_time sec. T. U) p+ k3 |! K1 G
    end
  y  E+ W5 I& b$ \1 ?" _1 Iend
- k$ |# n( O5 m, r1 t% @8 H
% U$ y) H  h' f2 O/ {0 E% y, M2 ]begin P_induction arriving
! A: I9 G! b2 ]: a' U' _    if A_induct=1 then clone 1 load to P_pick1
. X. G. h2 `/ v" t    else if A_induct=2 then clone 1 load to P_pick2
2 S* T$ k5 r% H        else clone 1 load to P_pick34 U" h& e- P0 d* Q0 V
end
$ @3 X6 @/ b! `: y9 C4 m1 q5 D2 i7 R5 X- K2 {+ ^
begin P_pick1 arriving2 E$ J6 g8 I8 p  [
    set A_i to 1$ B! W6 K8 t! i6 ?/ A/ V
    move into Q_induct1- S  m+ ?# G2 w& a3 L" g  B/ w. C
    move into pickaisle.induct1' a7 i5 R: L: u, H" r
    while A_i<=30 do begin
7 t1 S2 N1 \: t+ d3 b" q        travel to pickaisle.con(A_i). M, W! f& `2 O7 D! M9 T$ v6 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ G" ~1 C9 X* ?' I; R        else wait for 10 sec
9 O, P3 K- e. R7 F6 V, x        if A_i=A_leave then send to die
$ B" g: v# y6 p4 P4 I        else inc A_i by 19 K( b+ S) S5 ~
    end
  N8 ^: g6 b& V1 y9 z' }end5 P1 ~! C$ I" P6 T1 x
- p1 a9 v: G% y: V. @
begin P_pick2 arriving+ G$ f/ x- c9 m2 W3 Y
    set A_i to 11$ p. b9 K7 K6 e
    move into Q_induct2
, m  p3 f: d4 E  z9 d0 M    move into pickaisle.induct26 c1 [9 }/ k: E, u+ Q9 x+ Z, X
    while A_i<=30 do begin) U7 `/ p% C7 y" Q
        travel to pickaisle.con(A_i)- \0 {3 l  N" U( j) X! J. g  w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) j5 m, A) U0 w  J6 O" t8 _        else wait for 10 sec3 w4 F  [3 A0 u- X' @# o  H
        if A_i=A_leave then send to die  Y0 Z& [& Z3 b: q+ V: Y
        else inc A_i by 1
/ x* t  T6 C+ Z0 N# _    end0 g5 \' Z, X2 A" c6 U
end; b) Z+ E7 c# H, u2 c& q) ?4 C3 E

9 c" G7 Q' I5 ]$ f, Zbegin P_pick3 arriving
! V% X; e3 x* H0 |3 r4 s2 u    set A_i to 21
6 h; v" }7 R( M. M6 i4 X8 t- a    move into Q_induct3
& B& H2 M) J2 ?# O* n: r; w. X- D    move into pickaisle.induct3
1 F; B. r0 m- I% l. P2 |- ]6 B8 y    while A_i<=30 do begin
% B  r1 X9 p7 `' V0 t  |" ^' b        travel to pickaisle.con(A_i): t# l4 g8 ~8 t" w# Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {: \# l8 g* l. D7 h# R
        else wait for 10 sec3 Z& Z- q* v+ M1 g6 f
        if A_i=A_leave then send to die
7 w( o" y2 ?, M% G+ }2 m! j# i* Z        else inc A_i by 1, c0 a% H" E8 l4 A: g* P6 c6 l
    end) ^6 v8 {% I0 F3 A/ z4 A
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是个什么东东?$ P: Q2 u/ D/ ?( B/ z3 f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ t" v9 S" G. s
( U; U) i" B( C+ M
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# v) b8 F  D: w2 E: U

: v( B+ H& S; k8 C+ Z6 m) T  }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ `- ^! ^6 ^- s4 j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 W8 U/ [0 l. p3 a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 y  l# G. c* J  a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 K* P5 D5 L2 a7 r, d) G
begin P_induction arriving3 }4 F8 t3 Q3 z5 U, H: W
    clone 1 load to P_pick(A_induct)
. K5 \# o9 [% ^9 m. nend最大的系; f- k7 g: G' ]+ k  x5 q1 B- t% ^

* ^0 P/ Q) ^. Kbegin P_pick arriving
" P- m7 R. i( t- w: K' b    set A_i to procindex * 10 + 1
6 g: Q7 f2 T  @# V2 \/ j) k5 v    move into Q_induct(procindex)
& i0 f6 W( }8 j! [    move into pickaisle.induct(procindex)
0 O% K: p& w. o2 N) X4 h    /*check the type of pickaisle.induct(i), for your last problem.*/4 J+ ~2 f. @& y# e# j3 D
) g: ^8 G8 g1 s1 l
    while A_i<=30 do begin
7 z/ Y+ Z+ y* ]+ `        travel to pickaisle.con(A_i)
# Z! q/ n9 v$ p! a; _, A9 {: a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ L. S* b: e% ^' L2 E5 I        else wait for 10 sec
! Q! L! g9 T4 b3 F- v; o( F        if A_i=A_leave then send to die9 P$ Z$ r& @) V* E6 n
        else inc A_i by 1" j- O* w, ]0 m1 X
    end
9 G7 I# a  p+ l( w: B7 F, Nend
! a& P- N6 J4 `0 Y7 A- D5 b8 ]/ I) Y4 p" T
其中的procindex为整形,代表当前process的序号。) V" W# b7 x* A! n. T% e
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-7-25 02:33 , Processed in 0.014359 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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