设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9904|回复: 2

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

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

9 p& Y+ t! L: q/ g/ {/ Z  w$ ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 n2 \2 V) W1 Z- f! \5 n8 `0 B! f$ h" y3 E4 x* d
begin P_read arriving  O3 H% h% x: W. h  ]0 ~9 Q( T
    while 1=1 do begin
8 c) D& W0 B0 V& w        read A_tote from "data.txt" with delimiter "\n"
4 O4 d3 V6 x& H, F5 j+ G        read A_time from "data.txt" with delimiter "\n"# `1 x  v4 B6 h; q! Q' S
        read A_leave from "data.txt" with delimiter "\n"
! ^$ v, a0 O% i4 K1 ]        read A_picks from "data.txt" with delimiter "\n"
& K' T: F. s7 W& R8 y        set load type to A_tote
1 s+ Z- V3 ?; P1 o+ ^        if A_tote="tote 1" then set A_induct to 1
1 \' `4 @7 w( u6 W5 H% }        else if A_tote="tote 2" then set A_induct to 2
2 P  A. L" P& j# C4 f" i4 x            else set A_induct to 3    - K9 l& |1 b" i2 [. t6 w! b( Z; w* X
        set A_i to 0
% F6 G! Z+ W( v% M        clone 1 load to P_induction. I! |% \0 L: x5 R, X
        wait for A_time sec! V' x# z3 [! L. j  l9 R
    end1 O3 j! |2 U; y! h8 o, d
end
$ V( P, g) V" P( L& V: I
! `8 f0 ^, F. l/ y8 L6 Mbegin P_induction arriving( Y, E. }2 U; q: m% x
    if A_induct=1 then clone 1 load to P_pick1
" `5 h) L* K' ~4 X    else if A_induct=2 then clone 1 load to P_pick28 c2 G' |3 ~! S5 q
        else clone 1 load to P_pick3/ k. k) B& R* b' z& ?1 o$ R
end. t5 A: i: B. p4 u4 b

, t' O* j, D3 e5 O* y* G; j% \' Dbegin P_pick1 arriving
; H% j8 P- G  L; h5 j: b& n    set A_i to 1
0 h1 s, S. T# \6 O0 k7 k- |2 F    move into Q_induct1
, x2 H1 [4 F* [" Z+ A+ {    move into pickaisle.induct1$ B+ B, U* c$ W
    while A_i<=30 do begin
; ^6 e3 T1 w. g1 a$ h        travel to pickaisle.con(A_i)
' j1 S2 E7 Q: I8 W0 O3 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 V2 ^: N" n. E& z# R
        else wait for 10 sec
+ U6 J6 y7 P( a% s        if A_i=A_leave then send to die1 G5 a) V% p0 n2 A
        else inc A_i by 1
& C9 P' g- X# `2 o    end% J, m; z" V2 R8 V. s' R
end$ C" d: U$ }6 d" J# {3 ~+ f
0 m! R+ W2 Z6 Z! v# w' {- K% c9 k
begin P_pick2 arriving
! }6 _4 E8 ]% G$ J# Y5 g    set A_i to 11
8 x2 K8 W( d. M2 M# d: Q    move into Q_induct2
1 J4 j( j5 ^, X    move into pickaisle.induct2  E4 o7 y! ^* L. t7 z9 Q9 c! g
    while A_i<=30 do begin# [" V' Z3 o% b6 }
        travel to pickaisle.con(A_i)) a) h) j' R* D/ p& G# a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G" k) u5 o- ?4 D) U( q        else wait for 10 sec3 w6 L+ S1 L6 J& B$ B4 L$ h
        if A_i=A_leave then send to die' O& G* h* p: g  u: J* f6 Y' ]
        else inc A_i by 19 b; f- c8 e) [+ H. `
    end  K' H& ~' A5 M: K9 B; h: x
end
: p8 ~8 l" E6 ?; R# A; ]+ J% y
8 B4 b4 ?. q. h1 w8 I- e; Hbegin P_pick3 arriving$ j, H8 [6 z3 Z' w
    set A_i to 21+ f& h1 z: d7 x- U- L
    move into Q_induct3% B( D+ }- k$ y& J' `9 G
    move into pickaisle.induct3
, U9 n0 f3 d: X1 M' T9 J% a    while A_i<=30 do begin
' D- F& Z4 X6 K2 L" q( I% Q" j        travel to pickaisle.con(A_i)
# r0 N  B5 j! u' R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; w& I7 u+ u0 p0 h5 B7 ]3 c1 w4 b        else wait for 10 sec
% A2 k1 e8 g' a0 V" [' @        if A_i=A_leave then send to die0 {- v% b" o  Q2 X; I
        else inc A_i by 1
- Q% ]+ f5 \- `8 y  p3 a    end
+ U/ ]& R% |4 w( x* Uend

最佳答案

查看完整内容

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是个什么东东?, T9 X2 U9 j/ U. U' _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 i1 a6 v* I2 ^( U! C
# J$ d* z4 ?1 Z+ E$ R+ h5 ^- J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 K! }9 M; L7 R8 @0 h" ?5 j9 Z
. s; [* k7 p; F: U8 X2 B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- `; \3 S, z& G: K8 \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 K- y; [2 l* o, T+ L) Y1 o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. H0 f1 b# T1 \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( b# N2 N) P! X0 n
begin P_induction arriving
, x: W  e9 I% k/ `3 [* c* j4 r% N/ G    clone 1 load to P_pick(A_induct)
+ S0 j$ A9 Y- A& q3 H6 X9 mend最大的系, M' r4 L  D9 k+ w5 _* k

! j! N5 d1 T" Hbegin P_pick arriving
6 }+ X) ~; |: ]  F    set A_i to procindex * 10 + 1
6 e2 Q& {7 d0 f+ c' c    move into Q_induct(procindex)
/ i" U- U6 l/ I. |6 {# M# h5 \  I    move into pickaisle.induct(procindex)
; ?- S0 }- @3 o9 ~( |    /*check the type of pickaisle.induct(i), for your last problem.*/! R3 {  }! j* r# u4 M
, `& U: k) D7 L* o$ }
    while A_i<=30 do begin
) k" J* B6 z1 N/ n% V! C        travel to pickaisle.con(A_i)* q1 L! J# k9 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' `- A% y* }# |4 I& S: K
        else wait for 10 sec
! }6 q* V4 L3 U4 d# F$ t1 v        if A_i=A_leave then send to die  H4 e) G/ L- B% K7 a$ p
        else inc A_i by 19 Q6 I% J! B" L2 k
    end
5 [$ l0 F! Y! X7 oend) g) s" |; p: z1 [5 X  F0 a7 {2 r/ l
$ y" x+ i4 J  e( r( V/ n
其中的procindex为整形,代表当前process的序号。
5 ^: m4 P. j8 `5 H) o, N# astation和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-7-16 04:44 , Processed in 0.014653 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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