设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11660|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 u! _/ I# x& @. j; N6 m4 V9 I* H1 @9 \' y/ m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 c$ ~  q, g, u0 |
1 S6 t, @2 o  v1 L8 a& H% dbegin P_read arriving
, V+ v0 y' b! p0 h3 l2 s    while 1=1 do begin  g* ~: a8 V% n
        read A_tote from "data.txt" with delimiter "\n"* }. r+ [8 o7 k0 C+ v. z3 N$ v" s
        read A_time from "data.txt" with delimiter "\n"
6 j+ e8 J% ?6 H! |8 q        read A_leave from "data.txt" with delimiter "\n", b, {! M! V8 X% t
        read A_picks from "data.txt" with delimiter "\n"
9 @; |8 S# Q1 y' C% R/ @0 G        set load type to A_tote
2 N0 m$ M4 i7 a( O- f        if A_tote="tote 1" then set A_induct to 1
5 x3 \( q/ M2 i2 h* L$ I6 s) V+ U        else if A_tote="tote 2" then set A_induct to 20 U4 n; m- y. P
            else set A_induct to 3    + r4 \8 H; D/ d2 L& P& N
        set A_i to 0
% t& f1 V: I" M2 T  N6 M$ T        clone 1 load to P_induction
) j# @0 C+ [2 b        wait for A_time sec; G5 r. v; P* ?4 K9 J" ]
    end
! ^' U7 V- `( c4 ^end
. g' L; ~9 B( @. e2 I% J  v7 }! O/ L, L/ M2 H& F
begin P_induction arriving, s$ P+ ]% Z) f4 Z4 l* P% L
    if A_induct=1 then clone 1 load to P_pick1
6 A5 J' H9 n; b0 r    else if A_induct=2 then clone 1 load to P_pick2
0 \+ W% y( T' t. F- Y# @+ q( [5 T* U        else clone 1 load to P_pick3
: v% Z# p/ r( F6 a& z+ ^end. j" m; a4 A1 C* {$ h; m

! C8 E( a6 d8 d8 i" x0 M' L3 Bbegin P_pick1 arriving4 ~: F4 Q& [& ~" z8 c3 K
    set A_i to 1) G) h6 J) O! d$ d
    move into Q_induct1
5 }6 U+ v* r; r/ e. M. ?    move into pickaisle.induct1
/ P) T$ T  Y" s5 [% Q( T/ D    while A_i<=30 do begin
9 P# G' G- I) c( l! x8 {' O* R        travel to pickaisle.con(A_i)
* Q. n7 T. g0 K$ b  c  _7 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: f* |# N5 T, v. n        else wait for 10 sec+ F0 \7 V1 `3 J9 s
        if A_i=A_leave then send to die
* j! I& T9 o, l6 p' h3 n( j        else inc A_i by 18 d- b8 m, J4 ?% h  p/ @" T9 h
    end( e7 V6 o8 a, Q. o; d
end
: e4 Q/ E% F% ^4 ^
9 |' t# s; F  g/ l+ Y7 Tbegin P_pick2 arriving: a- _1 d: _  o9 G0 _- ?0 d
    set A_i to 11( O' F6 l/ h, L0 {# t8 O
    move into Q_induct27 L- {3 O9 {# K3 L+ k7 y
    move into pickaisle.induct2
7 W3 R7 x& u0 ~    while A_i<=30 do begin
- V! C: e  |9 B; Q; E! Y" F        travel to pickaisle.con(A_i)% T. @) r) v: w0 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 e8 P# F4 J: v0 b: K        else wait for 10 sec
2 K3 x9 t1 l2 _7 z. P9 J        if A_i=A_leave then send to die) \6 }6 K6 h8 U/ D
        else inc A_i by 1. s" ?, m7 N5 {3 ]& d
    end
) y8 ?4 o" k% ~  q) l! X" C- [end1 p9 E7 h  P3 z; [7 p0 N

( b" e  P. ?' b% r% u1 ^begin P_pick3 arriving
# F0 ?% \; T+ A; i: v! d    set A_i to 21/ e3 q0 V+ }8 o' m' n! K5 J
    move into Q_induct3
+ G3 Q! N5 n! h$ U7 J+ P% z    move into pickaisle.induct3
. _3 g+ V! y/ }0 N/ u    while A_i<=30 do begin3 Z) Q- T% n, f3 q% T8 i/ \( P
        travel to pickaisle.con(A_i)+ a* P; u  p- {6 ]% p; j/ V8 o9 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 a7 N* [* k5 ]" T+ [5 N. x
        else wait for 10 sec
7 M  Q: o5 O: P# O# [, H2 s        if A_i=A_leave then send to die
5 O. j+ W' _' Y) P' }        else inc A_i by 1! y" J. \$ d. X' ?2 K# J2 j. u
    end1 n+ r9 K6 X3 i8 c
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是个什么东东?, E5 C/ t2 B" F0 a& H' u: C( m1 M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# R/ t, S5 |8 |. H+ J

( `9 j2 L4 m/ I, i7 Y6 KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ T5 H6 y1 C. z- N2 v! p; U6 O
0 a: d- N* v$ l' [8 x6 j5 X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 v, i) g7 G3 w1 R+ ~7 W4 i" |8 N+ e' [$ x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. Q! [5 d* u4 z( w; \! m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 ~2 V8 W) g) _3 \3 L. p7 u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 _4 W8 U7 r$ y2 R) Abegin P_induction arriving/ F0 `/ L' \8 \) |
    clone 1 load to P_pick(A_induct)
6 F- {) g/ |# \: Z* p, Aend最大的系
" h! f- s1 o/ F+ r
/ Y5 f2 @) f* `* o: e- sbegin P_pick arriving
0 F* v% Q  a' ?- K$ D    set A_i to procindex * 10 + 1
* f6 T: U( A! V+ F    move into Q_induct(procindex)0 D# N# ?" n0 Z. n
    move into pickaisle.induct(procindex)
' ~% U0 a* ~% c6 G    /*check the type of pickaisle.induct(i), for your last problem.*/
8 @5 C! R; X; T2 D* T; D3 @
, K$ N* v8 n! V    while A_i<=30 do begin
1 H& Z$ i# p% x1 o! [* w& `        travel to pickaisle.con(A_i)3 V! {2 H0 E3 X; ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ F! @! I1 V( |% V9 Z' z# Z
        else wait for 10 sec
9 A0 h$ A- p# A8 }2 l" h        if A_i=A_leave then send to die: L& r8 g4 o8 D
        else inc A_i by 1
! R& T) _) h0 \7 R/ a    end  }" M8 e/ K$ j2 [( S
end* J/ Q+ F5 P# ?" @6 N
: v7 J7 _. `. H# `% t# ~7 ~
其中的procindex为整形,代表当前process的序号。
9 y8 p: \) B0 \' U' U! gstation和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-11-26 11:08 , Processed in 0.015684 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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