设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14049|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 T9 T1 j& T' {! j

4 E2 ^( S; r- r& 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中的数值,不知道会不会有什么不妥。
, ]$ O$ h! M9 H1 t" I. T' ~7 ^' g1 p6 V, k+ L
begin P_read arriving
. C( x* \" d# S; S. @" f    while 1=1 do begin( w0 ^" ?8 B0 J, q9 b
        read A_tote from "data.txt" with delimiter "\n"
2 u, g4 y& y$ Q5 b5 m        read A_time from "data.txt" with delimiter "\n"
- M# S; ~) N- p* ?        read A_leave from "data.txt" with delimiter "\n": Z: B" L5 m9 h( g. Y: y
        read A_picks from "data.txt" with delimiter "\n"8 H& ^4 _: @9 g) _) b
        set load type to A_tote/ V. y/ G. Z% c; B' T
        if A_tote="tote 1" then set A_induct to 14 d2 D4 o' k, S0 M8 P9 k
        else if A_tote="tote 2" then set A_induct to 2+ ?+ q0 Y! d3 s2 o( G  ?; q1 O
            else set A_induct to 3   
  f( E4 K' T9 s        set A_i to 09 u8 Z0 o6 m) g' g9 E
        clone 1 load to P_induction
+ \9 u* _9 Z1 W! p        wait for A_time sec
6 q* L$ f  \9 e2 K$ f& E    end
. s- K) {, w8 S( P3 h6 Tend
& ]  v& r4 @, g6 Z) }1 Q2 f
' w) |  [* [# Q. lbegin P_induction arriving
; }0 c- i6 }! o    if A_induct=1 then clone 1 load to P_pick1
- j0 w' o) Y, P  I2 M    else if A_induct=2 then clone 1 load to P_pick2
" r. P6 J0 s9 c, T2 E        else clone 1 load to P_pick3
4 q! E5 @8 |9 l( T0 x+ Gend5 L! ?; R0 }  o. F7 Z. s2 R
1 y& J% m6 X8 A5 }5 U! i' ?& U, ?
begin P_pick1 arriving4 @" |: ?( y1 ~% U- C! V
    set A_i to 1
6 P6 {2 m" q2 `    move into Q_induct19 o% `' v6 i' _" u& j- Q
    move into pickaisle.induct1
* |2 \& k% X: Z% K) Q* O+ _    while A_i<=30 do begin
4 I0 ?" r$ c+ Q  O$ a        travel to pickaisle.con(A_i)5 R! E+ L% a/ ]- w9 J: b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* _; F! x4 k: j1 ?
        else wait for 10 sec6 n5 `6 A% Q, V  e
        if A_i=A_leave then send to die% x( n3 W' N0 {) R: o! J. S; J
        else inc A_i by 1
# }: N) l5 m7 j( \8 L" x    end! |6 T1 Y& i; Y$ I
end( X$ |/ }2 S/ p7 @& A5 ^
: G; ^) A' d/ n" w
begin P_pick2 arriving
3 `" @# D# y6 h7 T- \$ {6 W" ~* G. K    set A_i to 11  C9 Q7 K8 g6 N" M7 J
    move into Q_induct2+ |) J* V% G' T( ~5 g% w
    move into pickaisle.induct2  F5 w) X; ?( M$ z5 }
    while A_i<=30 do begin, m9 r; B1 \, Q
        travel to pickaisle.con(A_i)
4 N/ z8 |$ F) B( |! T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: o; m% ^' V/ S) z- v/ |  z& P        else wait for 10 sec
% B/ C& @6 r1 f# ]' j        if A_i=A_leave then send to die
( a+ e0 {  n* V/ k- |        else inc A_i by 1
$ H9 v( ?' o9 [6 L5 A    end
- _" W" Y# [4 U9 Z' ~end
9 d6 ^$ Q/ k# |& b0 K8 D: N# b& V" P/ W+ K. O5 M1 ?( A
begin P_pick3 arriving% S+ G* J9 n/ P: ~, W# j; D" q
    set A_i to 21
1 j& ~" P* b/ I( I    move into Q_induct3
9 \4 C, Z) B+ H' e: X8 l+ `+ w. ~! B    move into pickaisle.induct3. k1 N, j+ ]  J6 \$ U' Y
    while A_i<=30 do begin$ D( U$ k4 w+ \. S; W) M; y
        travel to pickaisle.con(A_i)
% I3 N- y" ^% j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' C  [7 N$ K  r
        else wait for 10 sec4 h* ?* o4 q5 C/ |5 T- M: y9 x9 J
        if A_i=A_leave then send to die3 }" }. f' c; N) |
        else inc A_i by 11 s  Q1 d8 s+ |+ ?
    end
1 U: |! q% |% L/ Mend

最佳答案

查看完整内容

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是个什么东东?
3 V: T3 p2 g4 F, n" Qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, Y3 @: `0 q# @' R* @7 A' d8 E. z6 f; F3 X# n4 C) R& b0 S
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 q( Z4 i0 K2 R: z4 j
, P! }; x6 F" p$ i( N1 i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ B! |& L  O4 ~+ `( F% S) B: q$ ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 N4 }9 M- Y4 G5 e. \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 |8 @2 q0 C4 c/ K9 T  n8 o( X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 _, V, w; U& o) z& nbegin P_induction arriving# ]9 f  p/ Q" K; a* d/ B
    clone 1 load to P_pick(A_induct)5 P1 g* ^( y$ D( h
end最大的系
5 i4 r/ S& C! ]  [# O
& z" z, p5 x4 O% R8 a' h' vbegin P_pick arriving% |; }$ w0 h, R
    set A_i to procindex * 10 + 19 O+ N; u& k! g: j/ y7 k; C
    move into Q_induct(procindex)' b* o0 t: {. O( P5 M$ L3 \$ Q
    move into pickaisle.induct(procindex)
# t$ z* M$ |1 |    /*check the type of pickaisle.induct(i), for your last problem.*/
2 C+ t0 f) c) V0 t. V/ e
" T4 R: \5 G: \. ~% n% L    while A_i<=30 do begin" Q& l, v2 x) M2 l
        travel to pickaisle.con(A_i)$ ?- h( [' S0 N$ Q  Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S5 e7 a/ k2 V: _' S
        else wait for 10 sec8 C  y9 ?( M2 j+ a
        if A_i=A_leave then send to die
+ V% ?9 O% h1 @0 G3 u. w        else inc A_i by 1
& v( p  M1 [+ t& y1 |    end6 N" ]" m2 I  D" D+ V% n% g
end
6 Z8 o5 w* `5 l- K$ Q6 B
5 e/ v9 e7 G- r7 b6 g- Z: L其中的procindex为整形,代表当前process的序号。3 Z7 m5 ?% P% p  d
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-6-3 10:22 , Processed in 0.017457 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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