设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14413|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ~+ f7 B0 f: S" T2 n8 A5 q# q4 X% `6 i
, S- H  y/ w4 m2 g& Z& v我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! G0 Y, P8 e# K
2 y# n- j1 b! c8 @; Ubegin P_read arriving
, q& F$ M, X! Y' R    while 1=1 do begin
0 }3 Z( ~: T  p4 O# {6 |( D        read A_tote from "data.txt" with delimiter "\n"
& |6 @5 W6 E; J0 B- x# j        read A_time from "data.txt" with delimiter "\n"
, K0 [: A' j! a# z9 c6 H# G6 s        read A_leave from "data.txt" with delimiter "\n"
  Z5 w7 I9 `8 \        read A_picks from "data.txt" with delimiter "\n"; }$ e  F( g# D7 n' \' P  t7 ?
        set load type to A_tote( O+ b/ R  a  }$ s: |  Z
        if A_tote="tote 1" then set A_induct to 14 D8 P3 C8 u7 |2 M
        else if A_tote="tote 2" then set A_induct to 2
/ }6 N$ q6 ?: N: F5 N            else set A_induct to 3   
" R5 ^5 u. i3 e# ^        set A_i to 0
3 P0 O- U& p6 z5 K: f        clone 1 load to P_induction
4 |( B: I* I1 [" k. m        wait for A_time sec, u4 ?8 R: E/ H* N3 ~
    end6 d& x; l* P! o$ X
end  Q! l+ @1 L7 l4 [* C
/ `2 C2 A8 h) k; M4 D+ |! i' x
begin P_induction arriving: T9 n; R8 F+ Q1 p6 l: k% J- n1 h
    if A_induct=1 then clone 1 load to P_pick1
2 I5 G' Z- ~% w    else if A_induct=2 then clone 1 load to P_pick29 c% r- N$ g( f3 E$ A% ~# r2 H
        else clone 1 load to P_pick30 ]* p, a9 X8 F
end7 x1 q- R& M3 a2 }/ k  J
+ c  [$ a' Y2 r! N9 m
begin P_pick1 arriving
9 |, o, V( Q2 {8 G% V( `, I/ ~1 i    set A_i to 13 ~" m% p  A* \1 z
    move into Q_induct1
5 I) P7 u4 X. F9 [# `    move into pickaisle.induct1$ C& }, m; z8 I; L
    while A_i<=30 do begin
5 G! b( N% a1 l7 }+ j  ~        travel to pickaisle.con(A_i)
6 e# ?- a1 G! a8 _! W# s! _" G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X- v- N% P; v1 C- n        else wait for 10 sec
7 q0 t2 N  c7 J) }" h) _        if A_i=A_leave then send to die. B9 v0 j5 d% r
        else inc A_i by 1
  I% n, ]* y9 @+ T7 K. c. X% H* @% }    end( {6 Q: ~2 Q7 P+ @' T- z; \- t
end
8 \5 U' {" X9 Y* c. Q2 a! J' l0 [% i+ a5 w
begin P_pick2 arriving& e' C+ ^4 F" q1 a
    set A_i to 11
! K: S' `# L/ f( ^0 ]; a    move into Q_induct2
$ p# ?# p, n# {2 U' O) ?1 V    move into pickaisle.induct2' _* S* s5 {  P: d
    while A_i<=30 do begin/ I' Z# [; d3 o8 f/ t. c
        travel to pickaisle.con(A_i)5 F* b0 ~) Z5 _9 y& g3 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) F! Y; V: R' i" `0 v        else wait for 10 sec& a) S; z/ |. w! d$ G
        if A_i=A_leave then send to die
. m$ S$ u0 V3 e( k        else inc A_i by 1
2 y6 L5 v7 b9 ~7 f    end
. C" J8 G! H0 }) }% gend
( |% i3 x* H' J* W. P$ H( [, ^% k' d% @* d+ ]3 [
begin P_pick3 arriving
8 l( h' l& u  j5 [: \4 p+ S    set A_i to 21! u3 f& E8 q& Y9 H( s) i
    move into Q_induct3+ m) A$ ]0 `3 q6 Y" x2 Y4 r% L
    move into pickaisle.induct3! L4 i$ X8 w: A$ n4 {7 k
    while A_i<=30 do begin
1 f  [; {3 x0 y4 r8 N; ^7 u. z        travel to pickaisle.con(A_i)' M0 _+ u8 E! @; y, z% a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& F4 ?* C/ s. G# z: M+ E
        else wait for 10 sec
. r1 T: }* l+ h$ K! p0 {( m        if A_i=A_leave then send to die: {9 T" ]: B3 c8 S  L7 k& G
        else inc A_i by 1# o! s( @1 F* y5 k4 V
    end- I. K/ q; S( y' S
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是个什么东东?4 |$ k1 @. v9 b+ U1 m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( z, x. X: B) }) N
* t$ q$ _* H  v8 ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 E& M! z: {' p6 V4 T; ~$ w
# p8 U) e# P! l2 ^- K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. m# t, U- ^: ?7 m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; ?& R' X' `4 R* y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- a, z) x, t/ P, A/ ]& N5 u8 }; D3 z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 q/ F2 n4 F/ {7 b; Z% }
begin P_induction arriving
) I* _' t: E! H) w9 k% a. T" f3 A    clone 1 load to P_pick(A_induct)
6 @4 p, z8 f% k6 A* gend最大的系6 |1 g8 W8 v' T: v# U

' B$ B8 x4 d5 `* A3 m! W; x) Tbegin P_pick arriving9 o$ u* `# H8 {; U( y
    set A_i to procindex * 10 + 1* o  c4 X( M; N6 J9 ~# J
    move into Q_induct(procindex)
7 {$ W, l+ b1 P- R9 g+ t5 C    move into pickaisle.induct(procindex)% S6 |2 @4 c1 A* W9 e' w+ _( n
    /*check the type of pickaisle.induct(i), for your last problem.*/
, Y$ n0 y! W" n+ Z; U
4 x2 v; l3 a7 C; A/ j& w8 ^8 ]    while A_i<=30 do begin
* d. G* u( P. |$ z# \# j1 j7 K        travel to pickaisle.con(A_i)
8 U5 S6 F/ v/ M7 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 \5 d3 |) W' Z: x8 k
        else wait for 10 sec
9 @! X+ y8 K2 R% B        if A_i=A_leave then send to die, h  E5 S5 G. E( G/ L& O
        else inc A_i by 1- ~3 R8 j) `5 t4 R! x$ M
    end
- J' _. D7 D6 Q( k$ rend( U# r! I/ c, {# |- J

' c3 N- U4 z  y% v其中的procindex为整形,代表当前process的序号。/ K& [, X8 _3 \6 E+ @% h+ o8 d
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-7-10 11:25 , Processed in 0.015512 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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