设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11073|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. X% V0 K4 {- |8 f/ ^. {, d- T0 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) G" i: V$ h9 t  F: I2 X& I" P

4 j  y' Z4 B% e4 mbegin P_read arriving( h, z- Y9 T# v  E
    while 1=1 do begin
$ A1 s8 \" C6 `9 u! M        read A_tote from "data.txt" with delimiter "\n"7 a- d; a1 T: W1 D  a
        read A_time from "data.txt" with delimiter "\n"
! ^8 n, Z  r8 [9 ?/ a& r        read A_leave from "data.txt" with delimiter "\n"
; [5 Y) P* c" e) r, \        read A_picks from "data.txt" with delimiter "\n"
$ j8 o) t3 j( \  B  Q5 V        set load type to A_tote+ m, n/ m  C$ O0 ]
        if A_tote="tote 1" then set A_induct to 1
4 D5 ~; J( `  L2 n( f6 ?+ X+ T! j( ]        else if A_tote="tote 2" then set A_induct to 2
, t3 z% m$ s6 |# q- R            else set A_induct to 3    $ K3 k0 z+ \3 ^2 U4 F
        set A_i to 02 G+ _. y0 o: b8 B) `
        clone 1 load to P_induction6 B+ k& d6 b* u% B6 {: X
        wait for A_time sec( B( S- P% U% S
    end
# n( W$ Y% H4 N" \+ I2 Send
8 l: C8 ~6 O) ^. M: u' `4 x
* S' _; @2 a8 Z1 y6 `. b" ebegin P_induction arriving/ ~8 O9 n, h; {1 i' l: `
    if A_induct=1 then clone 1 load to P_pick1$ K: m% Y$ F5 I# g( G, Y5 G5 U
    else if A_induct=2 then clone 1 load to P_pick2
6 w4 y+ f1 {7 h8 w2 m        else clone 1 load to P_pick3. v1 F* i* I" X5 k, s
end
. I" e; h, Q$ J8 T# V# ?6 M' A( ?" f4 ~$ [# A0 K+ s' O" s2 X
begin P_pick1 arriving
- @5 x8 r$ Z/ C! x( @    set A_i to 1
3 I; M8 Z8 i& o+ l- O    move into Q_induct1
! N( E/ w7 v9 p) n8 ^    move into pickaisle.induct1
& ^0 m; j% k; o$ n    while A_i<=30 do begin
. e$ P6 \+ a) j* u        travel to pickaisle.con(A_i)2 x& y  r+ l/ A. x0 ?! e0 X, n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# a' [8 o# G2 e. ~2 ^1 X8 w: r' ]        else wait for 10 sec
8 y2 a3 h9 f2 g( F7 D' V, N        if A_i=A_leave then send to die& P- O% }/ T, k2 g
        else inc A_i by 1
  T1 Z) L% a5 @. x: h$ x    end% s4 F# _5 ]! l, u+ n# \) A: _
end2 r* [, |6 _* k
1 @0 F7 o+ [/ o' f. {6 L1 M
begin P_pick2 arriving& j  l# ?5 A) v7 \) ^
    set A_i to 11! ^0 g+ a6 @6 a: i2 m
    move into Q_induct22 ^, V: i3 q6 D
    move into pickaisle.induct2
$ y( s' c4 j  F! L& I    while A_i<=30 do begin
) l' @% u+ L0 S: _6 k        travel to pickaisle.con(A_i), T0 J: j3 V" X6 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 b! W3 k" f- T: d" x. e        else wait for 10 sec
% q- i: Q' N$ I/ m8 ~. f" z        if A_i=A_leave then send to die: l3 @5 i1 q1 ]3 V4 U# E& r$ r
        else inc A_i by 1
6 }$ i5 l0 K1 H3 q: P; A% c+ U    end
8 o1 E, ~# K3 Y3 g8 b# E3 \4 V3 Cend: u2 r5 l& I1 r$ P. X2 U7 f
! _9 o$ H5 M2 N  [
begin P_pick3 arriving
! e( ]% {: }/ |7 B    set A_i to 21
/ d  Q6 y0 r4 k  _4 r    move into Q_induct3
7 x3 B. A8 x* r3 E# `    move into pickaisle.induct3* _/ e) D( r" ~& T2 U% M
    while A_i<=30 do begin
8 Y' N/ F: Z( u; o        travel to pickaisle.con(A_i)
% K0 o8 V* o5 a* p1 Q8 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% B9 H5 h$ |3 a" [% I1 |
        else wait for 10 sec
# }3 v+ H+ r0 u. c, @        if A_i=A_leave then send to die
& j9 n9 v  z. t: E        else inc A_i by 1
, x7 v' _7 b/ K    end
* k  d* T% n3 g* e8 L. tend

最佳答案

查看完整内容

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是个什么东东?
/ n) m% F% d0 n9 c7 q" Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! }+ J4 ^. v; y# Y  F, M) S
( x" M. K5 I( e' ~8 V  j6 B; rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ M) Q1 O7 o6 e% v' E7 a

7 m% t6 E( _0 v, p! H8 D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ Z8 O! ~( x0 _  l* @) w, `! D8 O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 k6 g: v. {7 N/ X# l) L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! a* ]* [* f8 A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 Z  U3 V; ]5 R  R& c" K
begin P_induction arriving
3 ?% m& k4 d6 b* d9 O    clone 1 load to P_pick(A_induct)( f% F3 o& m1 c- A' M1 n6 v+ g
end最大的系! C; q3 O) e3 C' p4 a

# }8 {# I/ A6 x: gbegin P_pick arriving
* |2 d3 n& Q' C2 H. r( V9 [) @    set A_i to procindex * 10 + 1
( W2 g4 N9 d& _! X+ }    move into Q_induct(procindex)" ]) f" x" R: a% s# `9 V3 R* T# @
    move into pickaisle.induct(procindex)
5 e) ^4 V6 p2 D, O    /*check the type of pickaisle.induct(i), for your last problem.*/
5 w" l" H6 N# o4 e3 G
' C6 {& ?, t  m    while A_i<=30 do begin
5 J, C' ?8 P. h. `: l        travel to pickaisle.con(A_i)
  B( P2 E' i0 S3 B9 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ H% o  e% y" b: {( ~
        else wait for 10 sec
/ `- h  H$ f/ P! h- g; q        if A_i=A_leave then send to die4 y2 n2 X. F9 a7 ^4 M; Z) l# u# f7 a
        else inc A_i by 1
4 G1 q$ B+ Y  ~( k8 u) c4 a* ~    end
* l2 s8 u8 M; c, k9 L' e& L/ b' Send
3 _& A$ @4 k( p' W- t$ \9 ~# |. P! Z3 K# n/ F8 n/ X1 _/ @
其中的procindex为整形,代表当前process的序号。0 C3 B+ M: H/ N7 P7 L5 H8 \
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, 2025-10-17 01:19 , Processed in 0.019587 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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