设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15059|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; T0 \8 B1 w  |* g
, e9 F, O. q, E
我的问题是,在每个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 a' i: M: c( R/ r: m* B

) \0 u! n0 ~0 f- m( dbegin P_read arriving
+ V  f6 O- J) I7 ?; x! t4 U    while 1=1 do begin% U0 i' S- Q5 `, o$ F/ k, ?
        read A_tote from "data.txt" with delimiter "\n"
. L  o' ?& t: o2 F3 U: }        read A_time from "data.txt" with delimiter "\n", j0 [! z" k- K8 b, h
        read A_leave from "data.txt" with delimiter "\n"
* X# H8 I4 v4 x) ?: z6 D        read A_picks from "data.txt" with delimiter "\n"
1 r0 P- \, W: ?, }' J        set load type to A_tote; U" T' Z" W+ P; y/ d! o4 `
        if A_tote="tote 1" then set A_induct to 10 |  I- u% M/ `8 ]
        else if A_tote="tote 2" then set A_induct to 2
5 M! {% u3 _- K& L. v- x& y            else set A_induct to 3    . L* p0 ]. @* J
        set A_i to 05 I' {4 O. z4 c) T3 H
        clone 1 load to P_induction
( }- d+ @  e% \: ^& f' W+ Z        wait for A_time sec- j' Z& O8 s: y  Z
    end/ F8 V) {& _7 }8 I8 l
end8 J( k  o( v$ D, l8 s: h; c
$ e* s5 u4 g: Y
begin P_induction arriving
2 P4 x% p. y" W7 ]( n    if A_induct=1 then clone 1 load to P_pick1
& R, F8 O0 C% C) j6 L3 s    else if A_induct=2 then clone 1 load to P_pick2
- j; G6 X6 y7 k- `' {# t  S        else clone 1 load to P_pick3
" K! I: N* A) I  {' `end3 ?/ y2 a% h) m# R

+ Y& O# D- n% W7 U, L, Ubegin P_pick1 arriving1 r# U. ?: j( N- Z% m
    set A_i to 1; q9 x1 x6 n2 g6 `! X
    move into Q_induct1
; h& C7 [; E. O  d. E    move into pickaisle.induct17 N2 H( l+ c' Q# u/ h! {& u. @( i
    while A_i<=30 do begin5 [0 m# u: J  p# `. W1 m' g
        travel to pickaisle.con(A_i)
" U, C& c5 b% e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" t4 ~* e7 }0 K9 r) J6 J' J& [        else wait for 10 sec
# s. Q$ @3 y/ ]6 n  r        if A_i=A_leave then send to die
) y& l# Q0 o% f        else inc A_i by 1
9 s2 z* Y# ]/ a# t4 d0 H/ w    end
. H8 g, W7 C4 Pend7 z9 c0 p+ d, j% w6 T( @' {0 `/ [
4 m) ?) @: u+ S3 V
begin P_pick2 arriving
! X8 U) V* G, [% m2 o& ~7 ^    set A_i to 11( g; N2 V8 b" P4 N8 c
    move into Q_induct2" O- E. y4 C4 L2 m( x
    move into pickaisle.induct24 _! }7 Q" L, z& O+ ^* x
    while A_i<=30 do begin
3 {) }0 _' e9 A+ |2 L        travel to pickaisle.con(A_i): W  T: V2 |$ ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  B% i7 h$ M, x# H# l" z2 ^! W+ g- W
        else wait for 10 sec
' V* U3 `- E: |/ i9 r3 e" T        if A_i=A_leave then send to die
. |" A7 c7 N( }, H/ ?3 z        else inc A_i by 16 X, z9 w1 T$ Y+ }9 x* G
    end
; ^) w! s( r' J+ qend, M/ z; Y8 |# p7 M* E, Z. _" k0 D

5 y2 Z- Y0 i- U1 Jbegin P_pick3 arriving
5 G0 k! D+ Q1 R: B3 \    set A_i to 21
% ]- ?: q  w  ~/ K8 y6 |6 y    move into Q_induct3
& i/ y& n) w7 u  F1 k    move into pickaisle.induct3
. f* E! y5 G8 ^- J    while A_i<=30 do begin
2 B3 f, D* U, S3 m" G. G6 ~0 x3 p        travel to pickaisle.con(A_i)) d6 w( ?. z2 p) G( O. F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 d  u0 W. [* @# W0 A        else wait for 10 sec
/ L& E/ Z) X) T2 P: \1 D# k        if A_i=A_leave then send to die
6 ^/ Y0 I2 |% @2 R7 h        else inc A_i by 1" G  p" g( F6 v% F, Z1 `8 s
    end
. V4 E4 L) O" }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是个什么东东?
' Q( t" e  k( q3 r, v- ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 Y1 F. H- H- T$ d0 K
  t! p! Z3 q3 t% ^1 G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. B9 r& r; ~6 f' ~

2 d. T4 [1 j. a8 Q- ]! _3 X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' g+ H+ [5 Z- b5 k+ {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  f9 j: z2 J8 T1 I! H8 m5 V; o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% [6 a& V$ Z4 L" s1 _5 {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! T, G1 |7 l  a; Ibegin P_induction arriving
4 I" M0 _* h0 C5 n0 k4 W    clone 1 load to P_pick(A_induct)
7 y# B. X) ]. tend最大的系
3 T0 x8 e9 ?; G7 L+ Y( ?; \5 t% e7 Q0 L0 M/ Q6 K$ T
begin P_pick arriving4 |( _( y2 G1 K1 d
    set A_i to procindex * 10 + 1- ]* d7 \5 a6 y7 f( F. |
    move into Q_induct(procindex)$ G5 x. v7 m% O# s: R9 L, D
    move into pickaisle.induct(procindex)# r( P0 t# e1 x! n5 G% D/ ~( U; m
    /*check the type of pickaisle.induct(i), for your last problem.*/
4 o% A; T: [. j3 h. j( N9 ^9 r
6 D! }% U& r! [  F& x' G    while A_i<=30 do begin- R) X7 X6 ~3 ^* Y7 f
        travel to pickaisle.con(A_i)
! h" x# L$ [" U; i/ w  D1 P' u$ S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ @8 C) _9 b0 U3 @        else wait for 10 sec
" ]( c8 w6 l  z  G; I, j        if A_i=A_leave then send to die' h0 |9 |1 U8 M  N) K: S$ O$ v5 k* ?
        else inc A_i by 1
$ B1 ~4 H$ c4 O% a# C* x, T    end- ~+ D& Q& @) J. h' G* B3 @3 n
end. b# T/ n) _5 ?/ v! O- F

/ T! c3 x2 ?4 d5 K* ~" w其中的procindex为整形,代表当前process的序号。/ y1 x- j3 @. {5 f1 B9 }8 E
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-8-7 03:16 , Processed in 0.013855 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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