设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14141|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( l6 `" X3 f% V; R
0 K" |( a. m1 @$ n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% _: j# E/ l. m' Y5 L/ ]+ \4 s
. O* a1 U) ^1 m. e5 @begin P_read arriving' z* }! H' ]$ {& j: C
    while 1=1 do begin
7 g+ X3 F$ r& p7 }* W5 U        read A_tote from "data.txt" with delimiter "\n"
( o9 u) ?+ L! ^- k1 l2 O" R$ ^        read A_time from "data.txt" with delimiter "\n"
! s- E8 n3 E, I. e$ l        read A_leave from "data.txt" with delimiter "\n"
0 G  g' @, @* e; x) v        read A_picks from "data.txt" with delimiter "\n": W+ ?' F! T. U
        set load type to A_tote
! n" F& T. ]6 i7 U# i/ e  u7 ^5 C& k        if A_tote="tote 1" then set A_induct to 15 I6 Z3 A8 |' a( [" t7 a# [
        else if A_tote="tote 2" then set A_induct to 2# A0 w# R6 ^/ N
            else set A_induct to 3   
* v' T# X, `, ?6 B2 U        set A_i to 0" B8 G# y3 c( J; w" M5 `
        clone 1 load to P_induction* D. R& g% z$ K( X: [3 p
        wait for A_time sec7 H2 S: h0 Y0 H& o
    end
$ @7 b% g3 Q* o3 {7 b: @. Pend
  W8 g8 z& Q( O' O/ h4 @3 u6 B: S3 Y
begin P_induction arriving7 v0 n& J1 b' k0 X
    if A_induct=1 then clone 1 load to P_pick1# Y  N1 R- ?5 n" |4 C8 P3 y
    else if A_induct=2 then clone 1 load to P_pick23 i& u. m- C; B' i5 {
        else clone 1 load to P_pick39 {% r; f8 G" W
end
; R. I- `& g  t5 h' N2 ^) L: i2 W# J* E$ L% _4 I. w
begin P_pick1 arriving
% G; ^: Q8 A$ q( k  G" Z  g    set A_i to 1
  P( u8 d5 s# V    move into Q_induct1
; _' o/ n6 M( R6 F! h* C    move into pickaisle.induct1* ~# S. w2 |  \% v; c
    while A_i<=30 do begin
0 v3 U- {% N6 ], U3 `% K        travel to pickaisle.con(A_i)
( \2 u- X; Y. d4 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* a/ `) I1 \' j6 f. r2 }        else wait for 10 sec1 h, |, d. u; X8 s+ C5 L- R. V
        if A_i=A_leave then send to die9 K' X5 Q4 {2 J3 }, f
        else inc A_i by 1
1 W8 @0 Y( [1 H) k  r6 W5 }2 h# [4 F    end, L, W- K  r: V6 P- ?7 O
end
  J; |& [1 R% s% h  M$ r% J0 o# J7 s# M2 P5 o6 @* D
begin P_pick2 arriving
4 J9 R+ O' K6 k  y! U    set A_i to 11, B3 u9 y# O4 P  o8 ]7 k1 y/ m
    move into Q_induct28 Y* B: v0 T& Z6 a
    move into pickaisle.induct2; @# L+ D+ P. G, ]+ `
    while A_i<=30 do begin! g" H3 F& b" n# i$ u$ m5 Q
        travel to pickaisle.con(A_i)
) Y+ a* g' ~. ?  ?2 W, {5 }2 s# P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ?5 V5 h) z" v7 g- q! C% {+ x3 x3 z1 H
        else wait for 10 sec
$ T# u. W1 y! M& m3 {+ ^        if A_i=A_leave then send to die
8 W( G5 y) q& T8 I/ ?6 l% r        else inc A_i by 1
# `0 S) U! M4 L    end0 X& u* n! Q9 H& B% B0 C" I8 M  `% h
end' q0 H& z$ m' z- j, @$ m& n
* w* M! u0 M/ B) G( S8 c* a7 q0 U
begin P_pick3 arriving
* Y$ C; i- F& G/ M: J    set A_i to 21
- e! W0 s% ?8 C& [5 y, w6 U& I    move into Q_induct35 w; N: X' K4 s* o- c2 l$ b
    move into pickaisle.induct3
$ n2 H* l: k5 F- F/ @6 s" E8 C% v    while A_i<=30 do begin
# x+ N4 J$ ?3 C1 t3 o6 P0 D        travel to pickaisle.con(A_i)
$ r6 P. m; R- B3 {9 Z" o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 ?% U9 w8 M9 _+ V( s7 j' g        else wait for 10 sec
/ e$ B4 k0 _! P5 Y2 H        if A_i=A_leave then send to die
  r  Y2 g9 U, N$ u( i& O        else inc A_i by 1$ p! ?$ q: G, Y& z3 F2 }
    end
! ^6 G  C# ]5 q$ b' h% _+ \1 Jend

最佳答案

查看完整内容

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是个什么东东?2 C% E- K7 O7 w& P' b  O: D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, f  `& ?; |- c$ Y
$ ^, t# V) y3 ]/ R4 |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' e- u. t) n9 M$ j& A" {
" T) i( m( X) v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. K- t' ^$ I1 Q( i; {- [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. j  _0 ?* M( X! N% y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  u% h1 j$ G" [( b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, W8 `' `  \9 Y+ p
begin P_induction arriving
2 g. ]: F) ?; o% C  M* Q    clone 1 load to P_pick(A_induct)4 U. i* t1 {0 b! b
end最大的系% O( P  y: A" Q+ v: F

8 [8 M% E; v0 U  mbegin P_pick arriving5 n' b$ e' R) {# N  t# M% n
    set A_i to procindex * 10 + 1
, d' c5 R( P5 X% }. J* O& n    move into Q_induct(procindex)! L* r" ]) \, Z( F* X
    move into pickaisle.induct(procindex)
- w  D, ~$ Q! L/ C+ D% r0 n3 k    /*check the type of pickaisle.induct(i), for your last problem.*/( J' r7 h" C: ?& `
, C: u# a; p4 ]4 B" r2 ^
    while A_i<=30 do begin
: D- J! n  z* J) J        travel to pickaisle.con(A_i)
1 U2 D5 a8 @( g. A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( _2 j1 B2 ~+ I+ z        else wait for 10 sec
6 w' ]& b/ a- ?& b' P        if A_i=A_leave then send to die5 G3 w: [0 m; A
        else inc A_i by 1: b: I$ @- L: H* e
    end
" N, w" g( c6 j' r' M& B0 wend( D! v3 y9 A% h" q1 {' {/ B9 }

  @* _( E5 L' a$ o  W其中的procindex为整形,代表当前process的序号。
" a2 k' W, d. A9 Dstation和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-13 15:30 , Processed in 0.013512 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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