设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15055|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 [" e: c' H: o- b1 f
/ }- I/ M+ \# X
我的问题是,在每个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 S. E& y$ X! \8 V

8 X3 e# G% }$ C5 h7 {8 v. fbegin P_read arriving1 j% d4 h7 e" i8 U8 U
    while 1=1 do begin# h% [3 V7 _( P: U2 }% f
        read A_tote from "data.txt" with delimiter "\n"# D# k" @& l- X4 |' ~
        read A_time from "data.txt" with delimiter "\n"3 d; E. R) C6 S; x9 M! h
        read A_leave from "data.txt" with delimiter "\n"
. ?9 A" w) N2 U3 H5 M! G        read A_picks from "data.txt" with delimiter "\n"8 A9 B, S5 X! l3 c
        set load type to A_tote
% A4 x" l; |& j- ?; h3 [        if A_tote="tote 1" then set A_induct to 1% M9 Q9 @1 V% U( U9 O! p
        else if A_tote="tote 2" then set A_induct to 2
( t: Y. E8 `1 K( C" t  k' W            else set A_induct to 3   
+ O3 X; t, m8 d; G0 \        set A_i to 0& U8 y6 R7 ~7 t; p( h- F
        clone 1 load to P_induction
1 J5 T( R$ z4 r6 |, M+ [4 E        wait for A_time sec& a2 `' Y$ k# |4 B# G' A1 Q
    end
* M2 a2 K4 {; uend. N4 U6 w$ B5 K

1 }, F8 _' }  r! q1 z( ubegin P_induction arriving/ `  ~' k% l# l. i+ \. E/ b
    if A_induct=1 then clone 1 load to P_pick1
$ a" m& \: N9 x! r4 G1 j    else if A_induct=2 then clone 1 load to P_pick2/ C" _1 X* j1 b+ U9 o3 M! l
        else clone 1 load to P_pick35 [% q( w) i+ m8 @: c8 [! R# W
end
3 N8 L, V& U5 j! o2 R/ e
( a4 |# n, t; ^  j7 obegin P_pick1 arriving
! p- d- g1 P# t  Z4 w, i/ Y! k' Y7 ]    set A_i to 1
8 x" q  {: D& B& i9 z    move into Q_induct1* T; T' x# q; M# [
    move into pickaisle.induct1( W+ J* i% F/ g: G
    while A_i<=30 do begin
) l, n* d3 ]" s! b7 [* N! j        travel to pickaisle.con(A_i)
4 X$ r8 c2 r8 x: T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ D" L7 g& \3 d6 _2 T- ]
        else wait for 10 sec
& s( M6 H2 S/ q" t1 J7 o2 Y        if A_i=A_leave then send to die
% s6 _8 x9 C: L$ E" Q        else inc A_i by 1
6 q" S. R1 [* n; `& w: b) O! L    end3 |- ]) q0 o0 d! D
end- w5 H1 P& }+ l4 o3 H

! d- l* ~$ _  x7 n& Q7 vbegin P_pick2 arriving) B# w. x2 j  c
    set A_i to 11$ l' R) p8 Z' m) X& l  F) Z5 X' O+ l
    move into Q_induct2
* r: v: P( x1 b% K9 o& `: H    move into pickaisle.induct25 w+ Z4 a; t/ u; F. T! |/ t
    while A_i<=30 do begin
' d" o. C, E/ b8 F        travel to pickaisle.con(A_i). e+ V7 T3 h* n/ @  a% r4 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 t9 [& p8 `1 R+ o9 g: \
        else wait for 10 sec
6 K8 |/ T, G; F5 t- R$ e        if A_i=A_leave then send to die
8 G* A" c% A! a; w  ^        else inc A_i by 1
# R5 g# Y0 t3 U- N9 S    end% v" E# I3 a# ?! R# R: w
end. L/ Z7 i5 U" s- S' X3 |. N
5 z, S5 B+ Y0 u
begin P_pick3 arriving3 i! {, S8 ^! B8 A# [0 E
    set A_i to 21' B; A+ ]/ Q; P# X) v
    move into Q_induct37 H7 z/ d& [8 M8 f6 a8 c
    move into pickaisle.induct39 U# q( l3 |1 {5 a7 T8 b' v( Z6 O" L
    while A_i<=30 do begin
( K7 M; H3 \  K* P3 O        travel to pickaisle.con(A_i)
% y- l8 T# i) Y4 P4 E% h/ O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ {6 o  K$ `* l* v% S
        else wait for 10 sec7 c/ u1 p% U% g+ _7 J
        if A_i=A_leave then send to die$ I6 }- t. Y/ @' E" b
        else inc A_i by 18 y" _. _& a5 M$ k+ C
    end7 x( }3 X7 ?* \! @+ L! `  W
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是个什么东东?7 I) ~" s! N: w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" b% j" \5 D" A( u1 q, R7 H9 N/ Y2 ?2 a
9 Z& H$ b6 k) C7 l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* K- E+ n! ~; @2 P! ^& b

3 e8 i1 J* K* x# U另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- `$ Z$ f8 C9 b9 ^# M. b; z' J" f, i1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: f% X) O9 P" U- p/ u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ u% s' \$ M2 A9 ^4 K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: p9 I% A) O% M7 L* D, v* q
begin P_induction arriving
& @, e2 q* s9 B$ O, A  l" J    clone 1 load to P_pick(A_induct)
3 [+ p1 n* E4 m7 w/ G. S1 c/ Lend最大的系
; ^( q. }8 K& K4 J. g" C% Z0 R' L/ w) i2 _8 T- w! b/ k
begin P_pick arriving
4 K7 X1 b' s1 d8 f( ]9 e9 B: {    set A_i to procindex * 10 + 1
+ W$ R% g: I) W: p5 }    move into Q_induct(procindex)
# N, a$ x8 I! m3 N. p3 B' v    move into pickaisle.induct(procindex)( J5 Z4 N; Q* c/ M; ?: ?
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 F+ p- V3 h7 K% k+ m+ a" l# z" G
    while A_i<=30 do begin' q, c4 d, R5 ^! K% o8 ?9 y
        travel to pickaisle.con(A_i)
& u; P3 J7 @# t6 J: l! D* L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 p9 j2 k3 b! C/ B; T
        else wait for 10 sec
) N: f; S: h& e- \! V: d        if A_i=A_leave then send to die
7 D/ L6 g; X1 f! L+ m        else inc A_i by 1
* m; H: K. v2 e    end
, ~  n0 L, f: ^: B) H/ J! Wend
/ O( R6 }& O% p0 }* `: H' ^1 w' @6 [& F: T6 H3 S
其中的procindex为整形,代表当前process的序号。
- g/ {! J* y% U1 Wstation和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-6 23:26 , Processed in 0.013495 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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