设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12180|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ]: {5 o! \- S0 y2 R- C+ y3 A( g
6 b1 |) ~- _7 D: q% H# |我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 R2 x9 J2 I; m. G8 R: A9 q; v4 Y) N7 y4 w( I' K- O' {
begin P_read arriving
, L! F% D9 y) \* s( L    while 1=1 do begin
; f2 _6 o) b7 `9 Z        read A_tote from "data.txt" with delimiter "\n"
2 k' i/ V3 p0 c; F3 l: b        read A_time from "data.txt" with delimiter "\n"
0 c& M5 Q& N5 F' O        read A_leave from "data.txt" with delimiter "\n"$ b, a2 i" C& }  G
        read A_picks from "data.txt" with delimiter "\n"" A; F! V. z; N4 \  b3 w
        set load type to A_tote; s! D6 U) p' K0 B. k# @
        if A_tote="tote 1" then set A_induct to 1
( u7 ~. z  a% z' o/ y        else if A_tote="tote 2" then set A_induct to 2! }8 ~$ {$ l8 Y! k: t7 c
            else set A_induct to 3   
% u; P- ?6 W; m! e/ i; u        set A_i to 0/ i7 q* y- Y7 o+ W/ }
        clone 1 load to P_induction# U4 `1 n7 ]  E, U# O" H
        wait for A_time sec/ d4 L5 ]4 K. L# |: D
    end. p; B2 [- R6 R+ |# W4 S0 |+ d
end9 C% g* I2 |- R# Z. y8 Y8 A- b1 ~

; X; }% w3 S4 J9 P8 a( j2 ^begin P_induction arriving
* K) x) ^$ l7 c$ H/ J6 Y2 K6 W    if A_induct=1 then clone 1 load to P_pick11 l1 r$ N) Y, v, }/ x
    else if A_induct=2 then clone 1 load to P_pick2
2 ~: y/ Z/ I" ^        else clone 1 load to P_pick3
4 w4 ~$ [$ C  r9 E) ~5 jend
, u) q: w( F& A7 }, G* f) y5 V% F1 Y, h& K  a: Z2 r5 V0 G9 c1 U* ~
begin P_pick1 arriving) o0 C; p3 K1 r" {, w( j
    set A_i to 1
( r  X5 }& y( ?( x4 l    move into Q_induct1& K: d; g- u. v& b
    move into pickaisle.induct11 u' c9 W/ _4 i; z; P
    while A_i<=30 do begin
+ b+ ?$ `% B! V  z        travel to pickaisle.con(A_i)  ^! Y  i( u1 o. C7 g) r8 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 T- B+ j4 G/ \" ?+ q& [1 A0 G        else wait for 10 sec
* o! A7 Q; k! X        if A_i=A_leave then send to die1 ~& k, m3 g0 U9 L
        else inc A_i by 17 ^' i2 Z% I5 p5 _9 ^( F
    end# ]. }3 E, E& c8 e# V& J
end7 `0 L5 D: z, k' H3 G; a3 x
  u7 P2 U2 V# t& i/ e7 l& I
begin P_pick2 arriving
3 V% \% B: r: B3 i, K, }" k* q* `    set A_i to 11
1 c0 x6 A% e7 `: x    move into Q_induct2; E# O  @; d- N1 k4 [8 v  u
    move into pickaisle.induct2' [. ]4 Z+ p, ^* E
    while A_i<=30 do begin
/ z4 M0 r3 E) s3 m5 i        travel to pickaisle.con(A_i)% |5 f$ Z8 o6 o* Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& U& p3 `/ u: [1 d" _7 a, n. f        else wait for 10 sec
$ `% T7 n3 w. U( C) B9 U" s, x        if A_i=A_leave then send to die
" s8 C2 P3 u+ A  A) `! N        else inc A_i by 1
& r6 {- L8 o; y( v- p2 ?9 E    end& O9 s3 e; Y; {5 Q5 }' j( m' D( g
end
/ @! s) p0 [# A
& _1 {. f  J* M4 w7 M2 Hbegin P_pick3 arriving" X9 M8 ~% V( F  F. B' n9 z
    set A_i to 21
, o  e' e( @* Q8 o% t# H    move into Q_induct3
- Y1 F, l# S0 o: L+ K    move into pickaisle.induct3
$ k2 [- h# H5 c" L    while A_i<=30 do begin5 M! a2 f2 X9 N  w
        travel to pickaisle.con(A_i)
+ G0 h  |2 ]9 y& ^$ D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 K; C6 }' {* u: K/ u        else wait for 10 sec
% A. E0 ?: a  v& P, z        if A_i=A_leave then send to die% P8 Q* W, F; Y6 K8 h1 B
        else inc A_i by 1( D1 ?/ f# a* l' M6 W8 p
    end
! t( R6 [' @) b( 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是个什么东东?* p1 |8 ^/ g: `" r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' k/ O! Z; L5 }$ Z" a' A# L3 a5 n3 I; h  G8 ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) j0 e  Z" z$ W% N& |' j
8 F7 `9 e. A0 h& Z5 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 ?- z# [% w. f3 h- Q/ l5 O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% ]" m+ b- P( L- ~/ @5 O2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. u3 g2 h- _; I1 R6 m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) b! S' z9 j4 G( m( abegin P_induction arriving- n. G/ R8 h, A) x5 X
    clone 1 load to P_pick(A_induct)( k; e8 I* s  l+ x1 F* y* |
end最大的系1 ?4 G1 _9 H% I7 K! [" _

6 x+ V/ y! }! ?4 f* Mbegin P_pick arriving
4 Z3 p. d* I7 ?% |$ e' N    set A_i to procindex * 10 + 1
3 M% A1 @* b# [0 j    move into Q_induct(procindex)
" E- R0 ~& \$ J+ {, e/ C    move into pickaisle.induct(procindex)
7 _' \& M* v, a2 h    /*check the type of pickaisle.induct(i), for your last problem.*/$ Q. T5 n2 ^) T" ^  }4 Q  j

( k0 A6 o" Z' l    while A_i<=30 do begin0 [; b* H$ \# x6 v; f4 A
        travel to pickaisle.con(A_i)
0 p) z6 S  l) [$ }$ _0 ]3 o% t, Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' V3 s8 a1 Z! C, [
        else wait for 10 sec
6 N& w0 f3 _# d  J4 z0 r5 w        if A_i=A_leave then send to die
+ Z( r5 k2 M8 \        else inc A_i by 1
/ y' M- n) K! ]3 i    end7 @( |- ]8 u$ y
end
+ @3 o. f) b4 ]' A) S: s# x. q! e+ J
其中的procindex为整形,代表当前process的序号。' M" r3 s, z, w( F, O7 {
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-1-2 22:00 , Processed in 0.017065 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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