设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14310|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- E" ?0 x0 g+ K5 O0 s
* c" v4 j6 Y* J9 q0 x, y* 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中的数值,不知道会不会有什么不妥。; O8 ]* Z8 S: p. u7 [: i" s

: N: h  \& P) dbegin P_read arriving1 C, @/ S! e* C. ^* ?
    while 1=1 do begin: W+ H: h5 V0 ]7 Z3 T
        read A_tote from "data.txt" with delimiter "\n"' @+ t3 K/ v0 s: o2 M; q" j: x
        read A_time from "data.txt" with delimiter "\n"
( }8 J( V8 L3 f' W' l+ s+ T, F        read A_leave from "data.txt" with delimiter "\n"
3 J& k+ w1 x4 M        read A_picks from "data.txt" with delimiter "\n"5 t( e( r  H$ `1 h8 X( Q
        set load type to A_tote( M: b( g. b/ N$ |; N. a' }
        if A_tote="tote 1" then set A_induct to 1
+ x  ]# x  r* p  \1 q) b        else if A_tote="tote 2" then set A_induct to 2
; a# ]4 K4 v- t- f8 G            else set A_induct to 3   
% f$ Q: K' R# S$ }        set A_i to 0' _- n3 S5 |! }$ F& |
        clone 1 load to P_induction
8 }! w: Y. n: X! L        wait for A_time sec$ g3 m6 `. u! k" Z4 R
    end
3 t& s% `' P, N, x3 I; yend- X4 Y4 ^# b" U9 ?' U5 v
- g7 J7 k+ n3 |1 J7 p# G7 e
begin P_induction arriving  e, n8 I3 ~# v* L
    if A_induct=1 then clone 1 load to P_pick1
5 X5 d, r1 M! P# t    else if A_induct=2 then clone 1 load to P_pick2+ B% d9 H  j* Z: q
        else clone 1 load to P_pick3. |* u! `1 A' P2 e/ w, J& ~
end. D0 f1 S/ m5 G- r3 R
9 r2 X2 r# x/ V+ R
begin P_pick1 arriving  x8 J6 g& E7 ]( `/ ]% E. _
    set A_i to 12 [/ F: ~' N4 m/ c5 ]4 q
    move into Q_induct1# ~9 j$ f. P/ \4 \5 E
    move into pickaisle.induct1
4 w* r" B) }; h6 B! u' r2 L; n5 v# ?3 e    while A_i<=30 do begin) S* |7 b8 r& u9 |9 f4 d
        travel to pickaisle.con(A_i)2 M$ u8 d# E$ `  Z: ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: D. x$ C! d  p% y
        else wait for 10 sec4 C$ B* |) u! f; N% m
        if A_i=A_leave then send to die9 X8 E# g+ y& V& w  @; e
        else inc A_i by 1" `1 ]8 x8 l, l  |
    end) ]8 N0 c8 x" A0 q/ t- U! }" `
end8 |- M; j, e& z3 }
! s$ ^* Z( p: @% r
begin P_pick2 arriving9 ]8 Y; D7 M, f# ~) m% ~
    set A_i to 11' t* s$ @1 ]9 z: |1 C
    move into Q_induct2  K) S+ N) m( f9 F+ R
    move into pickaisle.induct2
3 k1 B' j* L2 k; Q; I) x    while A_i<=30 do begin5 E# z& w. p  w5 g' S0 Q  A
        travel to pickaisle.con(A_i)
0 U+ J! t; W$ f4 F* {- R. n4 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# b( e: s! c4 @7 c- |
        else wait for 10 sec, r7 N" Q* ], @9 o& V( p
        if A_i=A_leave then send to die
$ |' j. {' j% A- Z4 P        else inc A_i by 1- E0 \0 s2 h3 \; r8 h4 q
    end6 h5 q. F1 N9 \, s  d' |
end7 j" K' W& S7 X) P2 s
+ I8 r* _9 E: I( `2 N( n- s
begin P_pick3 arriving
% k; _2 L" j; e  ?" l    set A_i to 21
  j7 G* [0 Z+ u8 ?1 s    move into Q_induct36 _/ I- D/ l0 i6 N  G. ]  B; ?
    move into pickaisle.induct3
+ ~: `4 w6 M% j3 m9 A8 H+ G8 }    while A_i<=30 do begin" h: H2 \+ [8 q4 ?6 o; `/ l  b
        travel to pickaisle.con(A_i)
7 k# D. x& k, A. c5 [- g% N: q  R7 s& Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. e& C- {" b( z5 S  u  Q& ~5 _9 ^5 n        else wait for 10 sec7 A& T* s7 n6 H  y. }
        if A_i=A_leave then send to die7 o7 V; z7 |+ v. ]
        else inc A_i by 1' z9 W5 \0 I: [
    end
$ A( m9 A8 ?0 B% x- L! P  h6 ]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是个什么东东?, ^. D9 V, b3 Q3 K& T$ N3 E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. J6 P1 i  q, a- w7 ~# f- E7 e4 U9 d9 L* [6 ^
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- g* T$ F% m  P0 T

$ v5 J9 h6 C. a& K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) S# j# q6 Q; P' E4 l* `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ E" M7 y  n, o6 h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 j2 H+ _" |6 P% D9 f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, X* n, x" P7 K* `
begin P_induction arriving' P! h3 m' `3 p; p
    clone 1 load to P_pick(A_induct)
/ z! M0 y/ p* C. E" h' O) i3 W, iend最大的系
3 B+ }: J$ m  Q& I+ G9 L8 M, Y
+ u! I8 K, d- R2 K, k- t9 t; Nbegin P_pick arriving; I4 q3 ^0 q$ [7 ]
    set A_i to procindex * 10 + 11 ^, J+ k/ O" V9 S+ S) q
    move into Q_induct(procindex)1 v' L  q9 p" g6 P5 k
    move into pickaisle.induct(procindex)
& o! s. [+ C# i5 h# Z" @: N    /*check the type of pickaisle.induct(i), for your last problem.*/: k6 b, _9 A3 s( o8 r* E# ]* w: n
$ ^, m; z- B3 w3 I; B& b
    while A_i<=30 do begin* L1 r0 U! z$ H( o) r) m/ j8 c7 Z
        travel to pickaisle.con(A_i)
- Y- f- Q" J0 `5 i( e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, I. t( f! A  p& R
        else wait for 10 sec
) o5 g! @! ^( a* M        if A_i=A_leave then send to die7 l# G% w& H) m% \+ y( X) c* D
        else inc A_i by 1
4 F( H" Z% z1 w0 S! ]5 q7 Z    end$ S3 o: W4 C9 K4 w5 `! D% z
end+ E+ ?! Z, ^9 S, A

) g) g& \9 x) z! I4 U其中的procindex为整形,代表当前process的序号。( F: E) ]; y4 N+ w  F
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-1 11:14 , Processed in 5.060686 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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