设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14282|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ V# w( h5 h7 C9 V; S9 m
2 G9 M. A( P+ g8 _, L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 H2 f# J! }4 m$ D+ S$ r$ C7 ?8 a2 c: t4 n# [( Y+ h* N( q
begin P_read arriving. O8 c+ L! F9 d  q# C$ z
    while 1=1 do begin# G8 n+ g3 Y4 q
        read A_tote from "data.txt" with delimiter "\n"3 J/ _1 R; _) j* s" b
        read A_time from "data.txt" with delimiter "\n"& L4 u9 j8 }7 H
        read A_leave from "data.txt" with delimiter "\n"3 c( @, E3 w7 y' x
        read A_picks from "data.txt" with delimiter "\n"' X' c( r: V# @# ?' Y
        set load type to A_tote% }) N7 u" Q0 P" U; A" `
        if A_tote="tote 1" then set A_induct to 1
) ?' M9 o2 l9 p6 A  F1 }        else if A_tote="tote 2" then set A_induct to 2
9 G6 B# f! \' V7 z            else set A_induct to 3    ; j$ `; X+ R  }
        set A_i to 00 |2 g, P4 w; \4 H
        clone 1 load to P_induction
9 p$ g& G" a( R6 ]; Z        wait for A_time sec8 s' y0 v3 i7 k% T, `$ w
    end8 Q" a8 D( d0 J; |. J' M! S
end% T) W1 a6 e9 D' g( m& H
5 _( s" T9 |3 L: _
begin P_induction arriving
/ c6 T) e, _2 y! ~0 Z    if A_induct=1 then clone 1 load to P_pick1
1 R1 X' b' N. l1 m7 }  u    else if A_induct=2 then clone 1 load to P_pick2' L, h- z# s% K4 {9 _
        else clone 1 load to P_pick3
: Y7 q' J9 W/ Q0 \7 x3 }end
$ P- R* Z( D7 v5 H4 E! b" ]" x- @7 d% J- c
' {5 ^- R" i  T% J0 l( dbegin P_pick1 arriving
8 u  P8 f! U8 J. l/ J2 s    set A_i to 18 T( f; b0 u! t2 P9 G2 u; ]6 S
    move into Q_induct1
9 X/ b. ^) H" R+ _0 \' B' I' O" }    move into pickaisle.induct1' Z" ?5 \; S1 u3 x& a* f+ S
    while A_i<=30 do begin
4 O5 f, v6 R1 n- q5 L# Q7 B        travel to pickaisle.con(A_i)
+ |8 t9 H1 J1 w  X2 n4 e2 _1 a1 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 f& X4 E! r. w- y3 E! \        else wait for 10 sec4 \" x% k* f1 \$ W1 K/ i
        if A_i=A_leave then send to die* T* A- }  Y' K( S. b  L
        else inc A_i by 1
  _4 @- ~+ ^2 a7 @9 g, Y( d    end
# W2 T0 X* z' h. Uend
6 ^, X) F5 R- M( J) P* o6 N; f: k' z. X( d7 |8 A8 Q; T
begin P_pick2 arriving
* j: n8 G$ q1 P# M- t* S. y; @    set A_i to 11
! z$ K+ E! C5 b/ v- z( D    move into Q_induct2
& _$ C9 I% {( Q2 `( x$ U$ X    move into pickaisle.induct2) b+ [6 C. U( m- ~) |
    while A_i<=30 do begin- I/ Y+ y1 m& P, z3 y& u1 |
        travel to pickaisle.con(A_i)
! i1 n; F# M, d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; b6 k$ V( X1 [0 Y
        else wait for 10 sec
' q9 ]3 |! v# \: m7 D        if A_i=A_leave then send to die& A# a4 a) G% @& z0 l: ?
        else inc A_i by 1# u2 ]% T7 X! d8 H1 e3 \, G3 w
    end+ Y2 |# j7 F' M1 ~
end
4 Y$ W3 V" b/ d. `
# ^/ h  d  ~" f1 obegin P_pick3 arriving
- y  ]. Q5 g" p/ |$ N$ C    set A_i to 21# @  Z8 O5 }0 M/ @  n; {
    move into Q_induct3; ]' i8 n* P! l4 j
    move into pickaisle.induct3
1 x" e7 y& ?% A5 J# R) Q. O    while A_i<=30 do begin1 X+ r' Z7 b% t( M
        travel to pickaisle.con(A_i)6 ?2 w7 `3 ^0 N/ E# ^! x/ ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Y8 `' m# ]  X' }, M
        else wait for 10 sec
* X1 E1 Z  b, S& }; \- l        if A_i=A_leave then send to die1 n: G' @; v2 D9 c2 Q1 A2 N, |
        else inc A_i by 1
( [* h" N, v0 S, s) T: l2 Y    end
' N! W9 a3 B, y6 p& 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是个什么东东?
' V7 U( S! c( |" J* ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" \; N: g: b* [( Z8 h# t9 v
2 L" N7 d5 r$ |" y8 oAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" I) h- @1 G2 ^* x* ~2 ^; h
( t2 ~& A; E& {+ J+ B; F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% `9 w3 L& P7 q6 J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( Q, Z* j; F  `6 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ ]! l/ }9 r) s$ t" h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* E, ^0 p1 o% p6 Y; C% S
begin P_induction arriving
3 `% o: T: W+ c: p7 B! \; T5 H6 d    clone 1 load to P_pick(A_induct)
  h. c! ~! J9 F1 R, Uend最大的系
  g  K% o9 ^8 E# B- z1 p# T0 [. C$ \: H; L& Z1 W8 S( A! N
begin P_pick arriving0 @7 e, i) Z3 {, [; K* f2 _
    set A_i to procindex * 10 + 1
( M7 a5 d: O8 O0 |$ a: j    move into Q_induct(procindex)
8 x, o& x3 N  U( k5 q: P# E; H    move into pickaisle.induct(procindex)
  h" r& [) Y1 l( b% n4 B    /*check the type of pickaisle.induct(i), for your last problem.*/
; X8 x  o7 y8 |& f- r0 s" Z; `3 V# x* T  f  }) z1 A
    while A_i<=30 do begin  P( `+ E7 }+ ]7 E/ K' K1 I( c
        travel to pickaisle.con(A_i)  H5 t, r& f; c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  o0 h2 E6 r! C# u9 b        else wait for 10 sec% J  _. @6 w: ]
        if A_i=A_leave then send to die
& M- h) h8 a5 Z- Z  {% j2 e        else inc A_i by 1" G& k/ K1 Q; x5 T+ L! c0 H
    end( V  U# s! \9 l" P2 P+ N) f8 s8 e
end! E8 `" I9 E) ~  t2 w+ D; b; R
$ J2 [0 _/ \4 {$ d
其中的procindex为整形,代表当前process的序号。
7 R* b4 u1 v$ Q4 J% f1 e* o5 |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-6-28 01:23 , Processed in 0.015828 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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