设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11183|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. Z1 o  M/ m2 V( k; ~9 E0 M9 v2 \
1 Y9 A7 y$ y$ G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ v1 h7 x1 a$ }" s( n% A% n  p9 I$ \+ ]* I& f5 x) |! c
begin P_read arriving
: k* G. ?/ x1 `    while 1=1 do begin
/ p7 Q& k' \% e7 t; ^4 w        read A_tote from "data.txt" with delimiter "\n"6 N, e# i7 X0 V% M7 c5 g: X
        read A_time from "data.txt" with delimiter "\n"; u# `: j: X: f0 n
        read A_leave from "data.txt" with delimiter "\n"$ o$ u9 {1 i5 C; [) Q- V$ f
        read A_picks from "data.txt" with delimiter "\n"
7 V: w, t( s" j5 K* I+ E        set load type to A_tote
( X5 g' v6 j9 h% N2 c        if A_tote="tote 1" then set A_induct to 1
) q9 W. e  p- q9 y        else if A_tote="tote 2" then set A_induct to 2
+ m1 c0 H6 N9 d: P; u. N7 ]            else set A_induct to 3   
, N$ s3 m6 ?6 O% s/ e9 W        set A_i to 0. \+ j3 i0 a, Q1 T, l" N+ {) u# b4 x
        clone 1 load to P_induction; G! ~+ p1 E& B( r4 p1 g) I/ t
        wait for A_time sec
, ^5 L- w& `9 V- p1 k3 r" _    end
! b/ I9 v+ v8 Q5 c6 Nend. q5 s7 d0 {4 I8 x/ A2 J+ q: H

7 n6 N+ Z( d" w; |# A9 `" U/ W4 G6 ?begin P_induction arriving( m5 U+ `$ x3 g: v
    if A_induct=1 then clone 1 load to P_pick1
) q+ @* t! l7 y+ C8 Z    else if A_induct=2 then clone 1 load to P_pick2
! C+ v2 P6 c9 S( o# K9 ~        else clone 1 load to P_pick3
8 K: V+ S' ]! M2 qend/ a1 B: y' x5 H9 Q- [
4 Q' r& j% f4 i
begin P_pick1 arriving# \6 o" ?$ W% D) M, E3 b7 b4 @
    set A_i to 1
! m/ i$ I- v( o+ z    move into Q_induct1
! X+ S' _5 c7 S' J) f    move into pickaisle.induct1% o8 j8 P2 s8 r: f
    while A_i<=30 do begin
6 `9 R' ]& L/ [( ^6 n0 S9 _3 `7 z        travel to pickaisle.con(A_i)' o2 v! J9 E3 v- E& c9 p4 j. y% c! K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ F" [6 C9 o$ O# }8 z        else wait for 10 sec$ j( M! z1 Z" y! c7 p% R6 b9 c
        if A_i=A_leave then send to die9 j+ n$ B% o0 i# F% G
        else inc A_i by 12 l4 w% _5 L% S. J. ?* R
    end. T& O7 v- c2 ~6 z: V2 P
end" b+ I; w  K. Q% m
+ i  O' ?! K: A. B) K  y$ L4 P
begin P_pick2 arriving. ^  ?8 H% g4 V: n
    set A_i to 115 V! {& H3 x7 s5 J5 b
    move into Q_induct2
  [4 g* @* g9 x# n9 D    move into pickaisle.induct2* r/ n4 J7 ]6 A* H- G" j
    while A_i<=30 do begin
) N. z7 ?' M" h& L7 w3 {' X* l7 G) q        travel to pickaisle.con(A_i)3 T8 w4 O" B9 i: k2 \! ~: D1 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 s8 A0 \% m1 l, x) d  v        else wait for 10 sec, F) ^; m+ E6 n/ G0 c- O, e
        if A_i=A_leave then send to die
* {1 b, w. E9 m& ^1 D5 b( k        else inc A_i by 1% T$ k  J3 N+ k+ `5 z/ ?* D
    end
( z2 @8 B+ r# x/ h+ P  hend
6 v6 X6 f; ]8 _; e- G7 e3 V- ?0 U  w8 @) c1 i9 x/ W! g
begin P_pick3 arriving/ ^+ S$ [6 ?; B- F" h4 L% S
    set A_i to 218 B0 T3 S3 m8 `8 V3 i% ~( e
    move into Q_induct39 w. Y$ a1 t8 p$ K9 {- L1 |+ `2 ^
    move into pickaisle.induct3, Z$ d( K6 C" k0 h3 ~4 ?. Y
    while A_i<=30 do begin
( i* r; j, S  j0 S: U( H! U        travel to pickaisle.con(A_i)+ E( D' Q3 z) w( v6 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) l- D% X: a& P+ a$ L% o% b; T
        else wait for 10 sec
) u& p: f0 _. P2 D- Q; h        if A_i=A_leave then send to die1 P; H- g, n. y. i1 M. v" o
        else inc A_i by 1
9 v3 h4 ~) l$ S6 y, C    end" Y  m/ t! ^9 W, H
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是个什么东东?
. R8 M5 k+ p8 ^# Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! z# l+ u# z5 x, u# x1 R+ c
- \# `* U! o  [! n0 iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' K* ^& G0 Z. y# K9 X
# _1 J) T3 T# s; k( s- p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 d- e& s4 H4 v5 z7 W/ P; V6 ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 z) R0 C( {4 I2 {9 {+ ]2 g5 F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# l# y% T8 N& n. r% p1 f( U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 o& r9 I6 ^; z/ i( \' Rbegin P_induction arriving9 x: c6 T8 Q- t9 F7 v- @3 Q
    clone 1 load to P_pick(A_induct)
6 b3 J+ k/ U7 yend最大的系
, _! M( `$ n2 ~' J# n$ y) t  j+ `' j
9 c4 k4 e' i4 Y0 hbegin P_pick arriving
$ |7 J  u: ~4 L$ }    set A_i to procindex * 10 + 10 ^2 M3 s/ ]3 y/ P% s( U( J) D$ V" j
    move into Q_induct(procindex)
% N" X5 b+ m+ K7 f    move into pickaisle.induct(procindex)
( f' k/ {% H! u& @$ R7 Z* e    /*check the type of pickaisle.induct(i), for your last problem.*/
( Z3 G/ i( \; u% v! |5 L
# w& b# z' f2 E    while A_i<=30 do begin
! }' v2 M. f% t/ K4 a        travel to pickaisle.con(A_i)/ t4 a* _; M( z; L! g. [4 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  i5 a4 _: C; l" W  X) n; H        else wait for 10 sec! W3 ?3 z/ Z  Y0 q) l
        if A_i=A_leave then send to die
' r8 k/ i9 i6 t2 b5 K" a        else inc A_i by 1
" U- z- `$ {* C& F    end% h* f$ c& ]1 Z. r6 K
end
$ Z. w, Z1 s- D+ G" X! |% l; o, D' c& m0 f# L3 E7 f
其中的procindex为整形,代表当前process的序号。- W# L' t* F9 |( E2 U$ [1 @
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-28 20:42 , Processed in 0.021855 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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