设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13874|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 Z9 f5 P$ l0 r; t  a$ B, c/ c
- ~' R' Q% |& v9 T6 R/ 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 D. A* e6 m9 a3 H) `9 m+ C" P5 z( x
, J  ]; X) H! [9 A
begin P_read arriving- J; ~# E2 |% U, Q3 }' g% a
    while 1=1 do begin. g( g6 d9 ^# N( h8 [
        read A_tote from "data.txt" with delimiter "\n"* V. ]7 y0 x& a4 d3 c1 d# [! T
        read A_time from "data.txt" with delimiter "\n"
& [+ }, e, l6 t  s& U        read A_leave from "data.txt" with delimiter "\n"8 P7 f3 E" q1 U8 J+ t  ~7 L
        read A_picks from "data.txt" with delimiter "\n"# d  y8 G+ v+ M, h- t
        set load type to A_tote
+ i0 @9 D" o: [& Z        if A_tote="tote 1" then set A_induct to 1' j  _" J' W' \- |5 s4 ]' R- y
        else if A_tote="tote 2" then set A_induct to 26 d4 b2 i$ j8 H: n) H' l
            else set A_induct to 3    % v0 V% J/ o. G8 Y
        set A_i to 0
1 w  s2 z* z, V' U  U" P$ Z9 A        clone 1 load to P_induction
1 r* C: E6 g; E/ y1 I        wait for A_time sec* j( v& }  l0 k1 g: y
    end
0 ?( h8 v6 M0 h, u( j  g4 Vend
4 @9 L3 w$ N$ v$ c6 ?4 O1 K: b% i
: @8 J" A$ d# C5 t+ Ubegin P_induction arriving9 V6 u  s( `( \. _" r' O
    if A_induct=1 then clone 1 load to P_pick1
: i/ E0 e- ]% {9 [    else if A_induct=2 then clone 1 load to P_pick26 y- k* l5 n* `8 @/ S
        else clone 1 load to P_pick39 ]3 g3 H$ t2 Q& |, s
end
1 f/ T  W3 _9 o" M4 \5 j
! w0 w  N7 E# Z, Z: S1 f% ?begin P_pick1 arriving7 d, z- S6 Q) s  A- ~
    set A_i to 14 z  W$ X4 I/ `, d: @0 \8 G! o
    move into Q_induct1* w/ N) h( J# M  E6 i* K
    move into pickaisle.induct1) I8 E- z3 y. Z6 g% G/ b. p
    while A_i<=30 do begin
/ g$ E# \9 S8 K; a        travel to pickaisle.con(A_i)
4 m7 A% l. ~, d5 H3 ^8 |3 x9 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  l7 t' `! g! F! D; i8 B' j* ?
        else wait for 10 sec
8 V$ A% p) J# i9 D4 l' g0 D4 U+ e        if A_i=A_leave then send to die
. q( {/ M" r( `" I* Q9 P. l        else inc A_i by 1
; W& j, T- k# E0 J9 _- w: z    end
4 @8 }- ]; K1 d# Send
% W1 g5 a, Y3 H& E" n5 G
, L  D: ~! U$ W% P$ y0 c  {begin P_pick2 arriving
! d) s% o$ N/ p3 `3 p9 s2 C    set A_i to 110 p5 u. r) c2 ?5 ^; D4 }4 w$ Q
    move into Q_induct26 F8 }$ M: \& U* R. C
    move into pickaisle.induct22 X) j$ z/ U% F/ ?4 L" a
    while A_i<=30 do begin" l  y. Y) @5 \0 W" V
        travel to pickaisle.con(A_i)& f# h6 E$ D6 V/ _. p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- R4 H9 v% x+ w" x4 \        else wait for 10 sec: ]7 f  M: r. d" u# I$ \6 k. e
        if A_i=A_leave then send to die
3 M( x9 f9 n3 t' z. ~3 d6 C$ r8 [        else inc A_i by 1
+ f0 s2 e$ T  H) d& F  N    end4 J, T6 ]2 p. R: e  I( o" P
end/ h' E; b' ?% x7 P
& N; w1 O; ~; S( x& V3 B
begin P_pick3 arriving, q) p! s) {, _
    set A_i to 21  V' T* a6 z! }2 R  @5 \
    move into Q_induct3% Y" [8 H' h/ L: {
    move into pickaisle.induct3# Y- p* Y) ]3 [7 V9 |
    while A_i<=30 do begin6 r& ]; P9 N9 i# i( w% [6 y& b
        travel to pickaisle.con(A_i)
, m8 C8 N2 Z% Q# C- _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e" B7 E$ p4 Q" ~0 H( t
        else wait for 10 sec
. Q4 ]4 b: S9 _" g$ b5 u% O        if A_i=A_leave then send to die
3 A) W2 Q8 \2 Q) W5 W: A4 c        else inc A_i by 1
9 h; d4 C, _8 I- z/ e  n    end
; ^( f# L. M+ g, send

最佳答案

查看完整内容

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是个什么东东?
2 k" [7 T0 W" _move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# D% |8 I! I" W  ^6 L- a
4 @( A3 @9 h! Z- a/ D5 Z! c% V
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 T0 `: b. A- W1 e1 w' m& l
6 S; g$ s) M. }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 E1 ]8 e" H7 m+ B6 I' v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* l2 F% a: g% B. ^/ ~6 b$ _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, _- O9 t, I) X; \# R, F1 I3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! \7 ^% r8 C6 qbegin P_induction arriving. H1 O# C; q, W4 v
    clone 1 load to P_pick(A_induct), T( ?* _' L3 Z
end最大的系
( h4 F' r: Y, _" F  w: G
: m' [+ Y7 r) M! dbegin P_pick arriving; ^; ?$ s2 B5 U6 E- P( T2 E" Q% H: K9 l2 ]
    set A_i to procindex * 10 + 1
. m! z2 m! t7 y8 O# o* q& Q& C    move into Q_induct(procindex)2 ]8 r# ~6 B4 [) d5 m! z
    move into pickaisle.induct(procindex)
2 }  t! A: H" z" x" @# R    /*check the type of pickaisle.induct(i), for your last problem.*/
7 Z6 g- J* M1 {/ ?4 z6 E7 `" P- n$ V) @4 w- U
    while A_i<=30 do begin
+ L& O! k8 |& u/ V- ?4 t# d7 I) {6 O        travel to pickaisle.con(A_i)5 ~& a; @2 B9 W: s2 F7 d% C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) E" {* S( {3 |
        else wait for 10 sec
, x# c3 X+ }* D* @+ }        if A_i=A_leave then send to die1 B$ b- W+ q0 R& S8 W
        else inc A_i by 1! W/ T# z, k* z0 J& W
    end% s$ c( m7 _2 X+ o
end
* a1 L1 i7 C4 @: f* U% J& {- ?- b: T. e7 ^3 @
其中的procindex为整形,代表当前process的序号。, h9 X: A1 d8 P" C# \
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-13 19:20 , Processed in 0.018297 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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