设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13885|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 @  M) R. x+ E7 u* E
: t7 ^: d! M0 ~3 s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" P( k# t( U" ~3 X. v7 c$ @$ _9 r
begin P_read arriving
% Z4 W8 B+ S7 S; [& f$ U    while 1=1 do begin
5 P$ I( F% @/ ?        read A_tote from "data.txt" with delimiter "\n"
9 J  n9 G4 n1 m( X) B! k! r        read A_time from "data.txt" with delimiter "\n"
' [' u/ `$ F' Y! ?        read A_leave from "data.txt" with delimiter "\n"
5 a/ H7 O- V1 e( S2 E+ Z9 _- K        read A_picks from "data.txt" with delimiter "\n"3 k; c5 t2 n1 C' p3 h
        set load type to A_tote& G# c7 h" k) _9 a4 N* i
        if A_tote="tote 1" then set A_induct to 1
2 U# m) ?* f! f4 R+ n8 h        else if A_tote="tote 2" then set A_induct to 2) _3 \  r0 r/ w& K: [' P
            else set A_induct to 3    : @; G! r% f; {# |5 |& T, }
        set A_i to 0% R' }0 B% ~( k
        clone 1 load to P_induction
7 z8 X2 }( y8 u: X        wait for A_time sec. o; _6 u' @/ S$ A; k3 {# H0 K$ f
    end+ V! N0 p) `5 Y0 s" t+ n( R
end
/ M2 v* p9 w/ `7 l! A6 u; [: I8 m% y" [9 h0 f2 `
begin P_induction arriving
7 V& L5 r) [/ U& v/ x    if A_induct=1 then clone 1 load to P_pick1
/ h) z" x1 y; q7 N0 B6 z6 S4 ~2 C    else if A_induct=2 then clone 1 load to P_pick2
6 F! ~2 i6 ^9 c9 V' p. g  x        else clone 1 load to P_pick3
5 o- _9 T* Z- e( B& ^. K' Yend
$ O1 i" ~2 j5 U8 s: L5 ~  T( j3 E; O" J2 w# n( H
begin P_pick1 arriving
5 e1 j, [: b  @- ?. ~# _1 }- L    set A_i to 1
+ Q8 a& o1 ]" i  w    move into Q_induct1- S) @: ~* Z" n" G8 \7 I; {& I& u
    move into pickaisle.induct1
# u- g$ l: b# l4 Y! o0 g    while A_i<=30 do begin" w1 y' S" \9 ?8 i4 h* w9 X/ [6 w
        travel to pickaisle.con(A_i)
% R& e# t6 t8 a) t, G/ Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: r/ J& {0 N6 N1 S( h        else wait for 10 sec
: D3 M" E% }7 p8 U4 e        if A_i=A_leave then send to die
5 N! Q4 h' ]$ `        else inc A_i by 1
7 v+ N9 T* D7 F  @$ J    end& C1 ^9 T$ S; R& x; H- h1 V
end+ s* b7 u' `# N% E0 u2 c+ ?
2 y2 O2 r6 R% w) k' U
begin P_pick2 arriving
" E; o" P) {& h4 W    set A_i to 11
; j# h/ e9 ?- M/ ]* r    move into Q_induct2* N. H2 ]# w# w! N& C
    move into pickaisle.induct2
& Q+ g. Z' }: a4 [8 q5 A( k6 d0 s    while A_i<=30 do begin
' `+ o( ], ?( L! O; Y2 @( D7 R' ]        travel to pickaisle.con(A_i), K* C) Y3 P: u1 V' n& W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 J4 w% n% k4 M( `% {5 n( B
        else wait for 10 sec0 ]4 v8 B5 \' @, Y. {: W$ ^5 u
        if A_i=A_leave then send to die6 j6 d% ?4 T( m/ e0 l0 H
        else inc A_i by 1
1 D# d3 ?7 V; n1 H( }    end
8 N8 \9 |5 Z7 j% r) P8 u' l- rend
/ c; `9 L* |) l5 r9 O4 f# V) P# h
, p/ I! P  Q( N& q" \& obegin P_pick3 arriving
$ {4 |, m/ G) q2 g. \/ \8 P* T- g+ l    set A_i to 21
/ d) n' w& W5 \& F2 C- m3 n, R    move into Q_induct3- C3 B$ `/ K$ L1 e
    move into pickaisle.induct3, A1 l0 Q) ~5 X1 U5 a4 v% T7 E
    while A_i<=30 do begin; X. A( R, D1 [0 i7 D
        travel to pickaisle.con(A_i)8 X4 P* e4 H% U) ~# F) I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N* C: I6 f- [0 F7 s9 k        else wait for 10 sec
/ T! q3 D' t7 g7 e& P' S- s        if A_i=A_leave then send to die
' l3 m5 \, `9 W: t        else inc A_i by 1
, e4 h2 f: A) R- z8 E) {    end% _  S, g+ `4 l- k! [$ S
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是个什么东东?
. L: h9 ]+ y% v2 x) A6 y. d% vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  F6 I* w4 L5 {" |  S1 ?9 x8 f& ]( t
  l5 H3 p" o* X" X: s# q- t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ b) W6 Y9 b( f6 V" D
4 R6 w0 R1 F7 S) n& U* `6 ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& O' j/ |% |- }9 f+ V' X+ }" r3 l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ `) ?$ P! w9 A1 I$ x2 E* f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, f; }& F. K" y. m8 P5 L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" B: W- W- U# w- ~: G4 r5 ]' |1 `begin P_induction arriving
( Q) H& c  M4 A0 U* `    clone 1 load to P_pick(A_induct)
: T2 [' y& e( q% e% O8 pend最大的系9 K2 g  ~; E( B- ?9 }: O- q

5 k7 t: X9 A" |; o: Y& ]$ K6 M- E5 j8 kbegin P_pick arriving  F& T8 X0 O! w
    set A_i to procindex * 10 + 1
" L& j0 B# |3 ^$ ^$ i    move into Q_induct(procindex)
9 _% V. b& B5 T  f$ y- ^  e    move into pickaisle.induct(procindex)" y/ b9 d* L+ I% L2 h0 c1 q- F
    /*check the type of pickaisle.induct(i), for your last problem.*/% [9 X8 |* r5 i6 w) h& B) L
+ F* |7 D# D, W# ?3 g& d+ E2 ^
    while A_i<=30 do begin5 h5 o3 t! N% v/ R. T6 s: q: B
        travel to pickaisle.con(A_i)4 K- J' g& L# r; r' @$ Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' v  q% @% y) Y/ T. Z! E
        else wait for 10 sec
6 {  B6 S" q. m        if A_i=A_leave then send to die
; A6 f+ v# W9 ^" ]8 [- l        else inc A_i by 1' V1 n, L- G" o, P" m& Y* `
    end
, D9 j1 z# R# Y* _9 y& t0 }# N' Y# aend
+ J* w9 _/ f1 ^3 a9 O
: ?3 L  I1 ^! A- X其中的procindex为整形,代表当前process的序号。- z) y( q" b; [; ~' w1 w' L
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-5-14 14:58 , Processed in 0.017402 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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