设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13295|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 h$ E# J  e% W, p2 f
$ @; J) y$ F& |: q我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 N* k5 A. ^( l
; P+ L1 V! c) V: I* @3 x5 m1 h. b
begin P_read arriving
% u- b  f8 ~2 |" [) ?    while 1=1 do begin
- x/ F9 P! ~/ m% T9 F        read A_tote from "data.txt" with delimiter "\n"
( M, ]' `  j( c! P1 ~9 O; l9 k        read A_time from "data.txt" with delimiter "\n"6 A4 N1 I+ G1 U- p$ L! k2 R
        read A_leave from "data.txt" with delimiter "\n") ?6 D# {2 Y2 ^
        read A_picks from "data.txt" with delimiter "\n"
5 E6 e9 L7 r2 k* F        set load type to A_tote
) `  l# {5 b6 R2 J+ u2 |6 F        if A_tote="tote 1" then set A_induct to 1& c. k7 Y1 A1 E' l6 F7 N
        else if A_tote="tote 2" then set A_induct to 2
; |' |( c( j* @  \            else set A_induct to 3   
. |: X- S  c$ {7 \9 |4 F0 K        set A_i to 0
' R9 S6 \# s) F9 X8 _# m3 K' V1 p        clone 1 load to P_induction
- p& R6 J; k4 {, d8 h        wait for A_time sec
, e6 I; n* m! L8 B& h, c6 v+ y    end3 l. N7 n' H; s) W( i7 b; }. D  }
end
7 q3 b# c; P0 ]5 b* Q
) g! ~+ b2 J/ F, \4 n1 Mbegin P_induction arriving
! R; A) }$ h, A; O7 Q9 r    if A_induct=1 then clone 1 load to P_pick1& a7 y% U0 _( W5 Q, G
    else if A_induct=2 then clone 1 load to P_pick2  {( F2 E9 \2 A2 y* e4 _5 Q
        else clone 1 load to P_pick3
$ U! F: d7 [4 u6 Jend( `+ [8 s+ z) J- c' r$ g

/ d' S# v5 E4 M. u6 ubegin P_pick1 arriving" \7 o. N* A4 A8 p: j7 K
    set A_i to 11 f7 g  ~# R6 b" T* e5 ?( M8 u5 Q
    move into Q_induct1$ b( K/ Z' J! l  d* _+ b
    move into pickaisle.induct1
! ^& f3 d& m, r3 r5 X; N7 C    while A_i<=30 do begin6 `: p* a! T2 N+ E1 C1 `
        travel to pickaisle.con(A_i)6 b" S  A( L% n) Z0 Z6 d- ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 E6 M! N+ o: j& k8 Z2 I2 {& B  i
        else wait for 10 sec) [! L7 P" U9 \
        if A_i=A_leave then send to die
: x# h, b# D0 E( D, V        else inc A_i by 1
, {, w- M* V: q& i3 k" \    end) t" X  D1 ?6 A. ^
end1 p3 c; e* H# z! i& c  Q$ {
* l" L$ p' e7 c4 `6 c& Y" E2 b3 K# A
begin P_pick2 arriving% u% x' r5 A0 R% \4 Z2 l: M5 X4 |
    set A_i to 11
* `( Q* G/ w  o* L: k5 W$ f7 w0 B7 \7 Q    move into Q_induct2
% E: d5 Y0 a  h, \    move into pickaisle.induct2
$ d4 t+ \4 d# d% u3 R    while A_i<=30 do begin9 p! h9 u  @6 _* q8 Y' f4 R
        travel to pickaisle.con(A_i)( G  w0 {2 {# o3 F) }' d; g1 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) C/ _" a7 q" Z" x0 J% A
        else wait for 10 sec, W) w6 c! b. W! L/ E
        if A_i=A_leave then send to die6 L% C8 q- X7 O5 F& \
        else inc A_i by 1
, e6 B' j- d/ J5 e    end; m; W! L, ~3 e6 A% l# Z/ p6 N% r
end
. x: \+ _$ F% u# O$ T/ _6 \0 X: t/ }/ Y) n" }$ q6 ^: i3 n
begin P_pick3 arriving; N& e8 n7 g  ~5 J0 Q
    set A_i to 21; h+ U- N2 e7 ~. ?4 F! b+ e/ Y3 I
    move into Q_induct3* o4 G$ c) i# m# _% E6 M
    move into pickaisle.induct3/ k8 M- w0 q6 V% n
    while A_i<=30 do begin
6 F# S* q" K. W1 L1 l% r& Q0 ?        travel to pickaisle.con(A_i)* j/ |2 M- a# G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 G9 F5 ^; L) `. W        else wait for 10 sec
& s+ H9 I5 \9 U" e6 Z1 W        if A_i=A_leave then send to die- _9 ~: Q( l4 C
        else inc A_i by 1) y2 n" d# l' s: K; P
    end+ Z/ E2 V( |3 g8 o' `
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是个什么东东?
( o$ k: m/ B) M- Q1 ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# ?- q# ?! b6 b$ j, J5 k
, u; o6 y7 [  |' k' IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) e5 H2 O8 d! g+ C: Z
! V( i+ N* S8 k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- q4 S" s& Z3 G6 \/ L! d$ g
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- Q  F3 A) E  N; h* w1 d0 s4 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( A3 G# w' U7 k2 i# o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 [/ C8 l, U' F: v- i& A. ^6 S0 ]begin P_induction arriving& i& \+ L3 \, a- ]) _
    clone 1 load to P_pick(A_induct)
2 o9 V$ h9 F/ R( yend最大的系/ u' o) @2 b4 v
; x1 j7 ?9 T+ O# s
begin P_pick arriving
2 Y; i8 S% c2 b5 x) A; U: r1 N    set A_i to procindex * 10 + 16 X! g6 R3 e  W# T( `
    move into Q_induct(procindex)
; a, S9 [6 G. A8 H$ g    move into pickaisle.induct(procindex)
  I. ]+ ?1 k0 d# r4 V( L, z1 @7 l    /*check the type of pickaisle.induct(i), for your last problem.*/1 Z4 r# U  J5 ^

' e+ V3 L; D/ q6 w    while A_i<=30 do begin. X% r: `  e/ }
        travel to pickaisle.con(A_i)# H  m, I9 z& P6 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 C0 t& K1 U4 F& V/ O2 X        else wait for 10 sec5 ~3 U  k  Y/ i5 b& P
        if A_i=A_leave then send to die
) `" u5 v' `0 T0 N8 h, U1 }        else inc A_i by 1" S2 ^" P( r. L. {7 r& k
    end- Q3 j: O. L& [7 T4 {( Y( ?
end
* ~( `" o6 m8 g
, I8 b5 p$ ~6 l' V其中的procindex为整形,代表当前process的序号。8 I8 y1 t: t2 K: p8 q! g: ~. s/ g
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-4-2 03:41 , Processed in 0.017325 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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