设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14296|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  y! ^7 w3 m4 Z% U  W+ R' Q$ B
0 Z. \1 L& M- {- J4 j: f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' T5 K/ G0 m& T7 B7 n! Y
/ Z2 N( z1 V" z5 i4 cbegin P_read arriving3 K, T! |5 I$ `
    while 1=1 do begin
: C( B7 B( y7 E" V# I- M1 r        read A_tote from "data.txt" with delimiter "\n"  [# H/ z! c. a8 Z) S* M1 K
        read A_time from "data.txt" with delimiter "\n"
5 P4 v0 J2 c' W3 g/ A; d* |. |        read A_leave from "data.txt" with delimiter "\n"; a) a. ]0 j1 H. R) _4 ?
        read A_picks from "data.txt" with delimiter "\n"/ d- G6 j3 e/ i3 n5 j2 b. q. z
        set load type to A_tote
7 P$ U% T% K0 M4 V) J! P% d7 V# m        if A_tote="tote 1" then set A_induct to 1
! l+ I: T! i; n7 }. i% r        else if A_tote="tote 2" then set A_induct to 2; @3 W; Q* p! S" C3 s) R
            else set A_induct to 3    / z6 i) f* {; k  S& I
        set A_i to 0
( n5 s* P! @6 W/ I& T, r        clone 1 load to P_induction8 }7 s8 H( I+ ?, k3 p: s, i1 V
        wait for A_time sec, u* y9 u# \% v7 y7 D
    end* ~: a- {# A3 I9 v* W9 w1 y9 v7 H
end; n* K6 }" i/ T
3 h: B$ j  d( l6 Q( q% J- C
begin P_induction arriving: T; B7 _" j! @0 P5 r
    if A_induct=1 then clone 1 load to P_pick1( j  V- u8 _& y$ |( F$ A
    else if A_induct=2 then clone 1 load to P_pick2
1 ^. j  U# G0 q0 w3 `6 l7 k: d* h        else clone 1 load to P_pick39 b) Q0 y( j) b$ z) Q- L: b3 i
end
  E0 [9 I6 F$ m  \. G  I
6 z% i* s' j) E! v/ ?, cbegin P_pick1 arriving
% L; @8 c- K) y* z& g    set A_i to 1
' ]" g. j0 D5 o, r) H+ V3 d# w! B    move into Q_induct1" U3 L* z1 x/ W
    move into pickaisle.induct1
  m% s0 A: m9 L4 G( X    while A_i<=30 do begin
  D: G- w& ?. d) k' _+ [: N        travel to pickaisle.con(A_i)& k* A# r6 D) J% T4 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. |4 ^, p' [5 H
        else wait for 10 sec8 i3 K, [5 p6 p3 E% N5 ~/ ]- j8 ~
        if A_i=A_leave then send to die
) C! y; P1 v5 U, ^6 s% y        else inc A_i by 1) d4 x/ ~  x' b) e7 G' q
    end. c+ q8 Y8 u, O) n
end5 `& e4 o8 e3 ^. b

8 i" E! x4 m' J7 \- ^* dbegin P_pick2 arriving
: k4 H# T. q0 I* F8 ~5 d    set A_i to 11
0 u: M% M; t9 G% r3 o( q    move into Q_induct2
% Z1 S1 U" K4 S    move into pickaisle.induct2
) Y* _; v+ T2 t+ t( y    while A_i<=30 do begin
; ]5 b- a( u  a* |3 O% Z# [; B5 l        travel to pickaisle.con(A_i)8 F7 V# I  ~: i9 L# P" R2 Q9 }4 Z8 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y0 H1 k. i) G% w9 x7 E; s6 M
        else wait for 10 sec4 a. ^( Y, ^' M% Z& x+ l4 s1 d
        if A_i=A_leave then send to die# P$ k, I3 }& t" y
        else inc A_i by 1
2 P3 e% W+ e: E$ ]    end
( _0 i8 W8 x0 _. Send
' J% @) i( ?3 K( l  Y9 c6 u2 u4 \
! C8 F/ r% {. A" J0 A7 R: ibegin P_pick3 arriving5 b3 `/ o# c/ F" _6 p5 v& s+ c
    set A_i to 21
& ~% u+ z! P3 c9 _+ J    move into Q_induct3
1 O- v# @  y- I/ t    move into pickaisle.induct39 H5 E2 d0 x) h3 @9 b
    while A_i<=30 do begin) w; {" Q* v+ p3 T3 i5 r6 z
        travel to pickaisle.con(A_i)
( g0 s3 d  \% [% W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 n1 Q/ c0 C) D8 k2 K( ?: ^
        else wait for 10 sec
4 k( [9 r9 @4 |; b, Y3 n        if A_i=A_leave then send to die* D& e9 M9 h) {! C. K2 a
        else inc A_i by 1, h1 H* A, I1 R' w" T3 A. n
    end
2 g' k& S( C7 r4 R1 Pend

最佳答案

查看完整内容

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是个什么东东?- U; Q8 k# U9 `( O
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& H2 {$ E; c1 e, B# r& P6 s7 S8 Y( T4 [1 p' C, n! A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" r, V6 n& Q( F) H" C) c, k9 b8 b

0 Y! o* b, H. \- W9 Q: i8 o6 _另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% Z$ p5 J, A, A) f" i8 u/ v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 O1 G6 }7 M" h# m, g; Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 k1 ~( i" P+ F7 p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 t" B- w7 G, t% ~/ i2 g. Mbegin P_induction arriving5 X, |7 i% c) r7 Z' {2 C5 L
    clone 1 load to P_pick(A_induct)
$ x/ e4 f! A* w0 [7 e2 @  r4 yend最大的系0 X* H3 b6 @' C3 Q" v
/ Q* _4 j* t3 H5 o7 l, q/ w1 w
begin P_pick arriving
+ a' |  ~" ~$ F/ j    set A_i to procindex * 10 + 1( L: t+ h3 k0 b" {2 B& Y
    move into Q_induct(procindex)
( C1 [0 g4 }3 p. I* _+ `3 m+ f3 X& M    move into pickaisle.induct(procindex)
) G2 [" l# k1 o" P  c5 A& W    /*check the type of pickaisle.induct(i), for your last problem.*/
. u: o+ Y" T6 k1 f& a; R4 e
2 N  k- B# r; q) y, e" Z. D. g+ N    while A_i<=30 do begin8 A# d% D' F; t7 \$ h9 g, W
        travel to pickaisle.con(A_i)
, e& a8 G% t. o7 U% @4 H  K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 r4 Y/ I) m7 J+ B
        else wait for 10 sec
% s6 p( e: Z# N- J3 @* a        if A_i=A_leave then send to die
& l; W6 d: H/ _$ f: ~, _3 W( e8 }        else inc A_i by 1
+ m  ?/ w7 ~. m, t    end! Y2 M$ Q! n! ]/ }
end; x' ~( l; p+ S) k' C7 Z

$ U* \' j& H: X/ ?1 l% r, b其中的procindex为整形,代表当前process的序号。
" R' r' L& u" 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, 2026-6-29 10:02 , Processed in 0.017648 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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