设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14414|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 M2 l3 {$ a" M6 P0 D; B

4 _0 c* r$ c+ `3 Y8 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。- k7 w9 w7 y) ^" h; N

+ Y$ v( G( z. g; D2 vbegin P_read arriving* \& x# U& R- x. y) C  M
    while 1=1 do begin
! z: s$ N; ^. c( R( ~+ C8 }        read A_tote from "data.txt" with delimiter "\n"
8 R7 H  }; ]6 u7 U2 u% l        read A_time from "data.txt" with delimiter "\n"1 G: U( ^7 w3 a
        read A_leave from "data.txt" with delimiter "\n"/ p. k' B8 A6 _
        read A_picks from "data.txt" with delimiter "\n"4 ^* X( d! \' h/ b/ A+ Y7 @
        set load type to A_tote3 ^0 y5 a; e5 w; r( |0 P# y9 w
        if A_tote="tote 1" then set A_induct to 1
2 S0 v) K2 G/ _, O  F        else if A_tote="tote 2" then set A_induct to 2. M4 ]$ F( |6 c: j# v0 `
            else set A_induct to 3   
1 n! Q  c( G; [+ S" z1 O1 g        set A_i to 0
% o7 C- ?; L; N/ |% W$ Z        clone 1 load to P_induction2 L  _6 x8 Q" A+ c
        wait for A_time sec
, w- V, z4 g0 h    end) p2 [/ i0 N. ~( }- _7 _
end
; M1 v2 h' W" y; G4 `, f) ]9 U. A( K1 V
begin P_induction arriving
' D$ {7 K/ x8 g) Q/ [5 ^7 g9 r3 Q    if A_induct=1 then clone 1 load to P_pick1% D' R1 [1 o. H9 g7 g
    else if A_induct=2 then clone 1 load to P_pick2
* d! Z2 d+ _( Y0 x( B$ l, B        else clone 1 load to P_pick3
0 p+ M  w" l" L5 M2 w* c, H. `1 pend
9 I: W9 _$ K$ e/ S$ _+ j4 S% q5 T2 w) S# ?  b
begin P_pick1 arriving
( U$ G0 A% T; a+ \" v! F    set A_i to 1
6 f& V9 S' \6 z! a* A& D9 e$ y    move into Q_induct1
8 V& \2 i% Z+ I: a0 a3 R    move into pickaisle.induct19 f4 t' l9 F; ]
    while A_i<=30 do begin) Q; M- O7 M# T, W
        travel to pickaisle.con(A_i)2 t! H7 C% s. \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- Y  o' r' ]4 J2 H        else wait for 10 sec0 @# T' S! C) U: @
        if A_i=A_leave then send to die4 c( i1 R) S. S  M' |1 W" q& w
        else inc A_i by 1/ z0 K% w: b- S  w0 x& `% }
    end
; S5 g+ \2 r5 B. m4 s3 Bend# l) Z. B2 l4 Y# t' R5 V6 Y

& I, s' Z- j/ K7 U7 l4 J' vbegin P_pick2 arriving. A0 B+ r4 F! l6 B6 r
    set A_i to 11( `9 G# f, V& c8 I: m
    move into Q_induct2
% U) a0 p7 b/ Y# X    move into pickaisle.induct2* r2 c. q1 X& t0 n
    while A_i<=30 do begin
# M. _5 M1 M& ~: k        travel to pickaisle.con(A_i), N( o4 U4 e& Z% v) _/ e. \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  O3 `8 L# l- c3 f) {- o        else wait for 10 sec" z. ~1 z! `. j, Z2 {& f5 ?1 K  w7 k
        if A_i=A_leave then send to die
9 z* O; J( h6 ?8 X        else inc A_i by 1
$ H4 Q) E1 k: E0 f/ h    end% S* H1 D1 [; B9 p1 x
end
8 y. [5 t, A: E% [6 @' h+ U3 @1 ?
. b) `1 d1 Q' S' [+ {begin P_pick3 arriving
% [8 P- b  ~1 @+ l$ a    set A_i to 21" n3 L+ ]1 j; b
    move into Q_induct3& F; l; B. F8 f5 U
    move into pickaisle.induct35 P* G( D% O' U3 `( l4 ?
    while A_i<=30 do begin
+ j# u8 C: s6 z1 Y! I$ ^4 T2 H) s        travel to pickaisle.con(A_i)
) s) N: {3 O, Y* {5 V& f9 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 t; v* ]9 J  Q9 ^5 l1 Q% N
        else wait for 10 sec
5 e% V2 T2 t2 g        if A_i=A_leave then send to die
1 S( ?% }2 \6 {. i) V        else inc A_i by 1$ l9 |( |" L8 A6 j" @
    end
& a0 J/ U" d% a3 Q8 Z# send

最佳答案

查看完整内容

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是个什么东东?
' T9 K6 Z% }6 x: tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 S% G& t) M! g& p# w6 F  H$ I4 i7 I! p! t: V5 X4 B4 u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 n' Y3 f1 O9 O  ^

( x4 j1 {$ d- r  t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 L! L4 C8 C7 k2 D5 z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 ]1 u' V2 ^5 i( a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 b+ z* a4 I/ ~2 J1 P& n: D* s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# V. Y$ J' t8 |9 wbegin P_induction arriving
7 U" ]( y( I7 K- S    clone 1 load to P_pick(A_induct)) \' ~1 c3 c  C7 @
end最大的系
7 M+ t# e- V# ?; Y1 r% \, I  ]8 @/ d3 S( l6 @
begin P_pick arriving
5 f2 O. b: G6 `) k: |    set A_i to procindex * 10 + 1
) z4 H7 I" j* o4 h    move into Q_induct(procindex)
8 m5 @* m% l" o# s0 r    move into pickaisle.induct(procindex), j* H. o9 s8 U. E( S8 \
    /*check the type of pickaisle.induct(i), for your last problem.*/- I1 f$ W/ z" |$ T, e. [
8 Z8 ?& S8 o; E9 @8 x' Z+ v- D
    while A_i<=30 do begin" p% R. O' U' n/ W
        travel to pickaisle.con(A_i)' |3 z) A5 i- E, k" z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" P( }- m% p/ h$ `" e
        else wait for 10 sec
/ x, ^0 j, J7 e# x* K        if A_i=A_leave then send to die
* N( u( g3 a# g% {6 C        else inc A_i by 12 x& Z; _3 I: L; U: j7 x; u: b
    end
8 t- g& Z1 X3 V9 e' send6 N9 m8 u; g' |" l2 T1 n/ _
; X; i; Z& i/ |6 a
其中的procindex为整形,代表当前process的序号。- o- |, |1 U- y1 y
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 15:35 , Processed in 0.017137 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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