设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12625|回复: 2

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

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

% y% B+ c! U9 y- 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中的数值,不知道会不会有什么不妥。
4 q9 K' a9 r+ s$ Y
" N8 b# R% o6 gbegin P_read arriving2 p, y- l5 @: E6 s9 Q3 A
    while 1=1 do begin# q# m4 H2 c$ N0 Q9 n
        read A_tote from "data.txt" with delimiter "\n"
3 P6 ?; k+ N4 B6 v: i3 E3 w/ f        read A_time from "data.txt" with delimiter "\n"
% u+ r+ S# `4 x/ ^2 u" ?        read A_leave from "data.txt" with delimiter "\n"& K5 R* b& A0 Y; B
        read A_picks from "data.txt" with delimiter "\n"
  W9 z4 D4 y) E. A. ~: A        set load type to A_tote) P6 Y. S; U3 \" h  l! C
        if A_tote="tote 1" then set A_induct to 1
4 F1 {3 d- M( p# u8 H% a        else if A_tote="tote 2" then set A_induct to 2) m. t7 k/ c! t; I1 X* O
            else set A_induct to 3    ( P! p; H% f' F3 T
        set A_i to 0% s  ~5 K6 z8 o8 O
        clone 1 load to P_induction
8 v6 [7 N( t; C        wait for A_time sec
3 I, Q. l- P, j- Y3 r0 A    end
+ t6 R) ?( q3 k& Pend
: P( D  R* j1 ]" e; J3 \3 N+ C1 q1 \- J' m' q6 V
begin P_induction arriving
3 n$ j/ S: L4 @( d" q2 g' J    if A_induct=1 then clone 1 load to P_pick1. l2 m/ @9 E  y  a, {
    else if A_induct=2 then clone 1 load to P_pick2
- N5 G+ W/ p* q, c        else clone 1 load to P_pick3
5 L: y% n8 W1 I2 V. g! ]6 Send
& `, B8 y2 F5 e1 ?$ Y3 I' L$ q
begin P_pick1 arriving
1 e& C" v8 H/ R# p    set A_i to 1
% ~  t% }3 A2 D* B: T* U    move into Q_induct1
+ z2 C8 s$ Q3 Z+ y5 G# u    move into pickaisle.induct1
2 {; s4 h5 B# p+ l8 r# b" [    while A_i<=30 do begin7 _0 x: m2 a+ S" O
        travel to pickaisle.con(A_i)
# Y4 ?: I, e" |" e+ m8 r6 h% u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 A% b2 P( O  o! ]        else wait for 10 sec
) \  D8 y* M# s8 t, ^        if A_i=A_leave then send to die
4 e/ f* z: W* y9 Y        else inc A_i by 1
# |# m1 `  U, r    end
  I2 @" M7 F7 qend
, n* l- F: H  c; h4 ~' q7 w( X$ H# {# a) E# n5 A% X
begin P_pick2 arriving( ^; t/ M( D% Z* m
    set A_i to 11# L0 F0 f( e- d. p2 u% b
    move into Q_induct2% a5 M1 M! @, P+ J0 G
    move into pickaisle.induct2
4 b8 S7 g* c6 y  h# `  M2 o' b    while A_i<=30 do begin% b1 i/ |4 o8 i: ?
        travel to pickaisle.con(A_i)
+ d" N7 B) D6 L7 B1 f6 u6 Q) P% B/ k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \( \1 p5 Z" ?. ]        else wait for 10 sec
# ~2 I1 ]* Q& H( ^2 D* r0 a7 g        if A_i=A_leave then send to die% V1 W8 Z' G# q! s: E
        else inc A_i by 12 b) [; ~4 q6 C* F- M+ P
    end0 n8 Z! p+ g: s4 u: {+ j( ^
end
3 c; C3 \; B8 J0 i7 H7 B5 l- r0 r% s( B& i: R) {* S7 B& a
begin P_pick3 arriving/ ]! Y' `/ ~1 o. j& X" R
    set A_i to 21
5 \+ I3 `9 X2 k/ p    move into Q_induct3& r+ I8 h, L2 ?; x
    move into pickaisle.induct3
/ X- B+ ~( ^, Y+ w: p1 t! P" |$ C, l/ K    while A_i<=30 do begin
1 G7 [& G7 M5 B- S+ p        travel to pickaisle.con(A_i)  r; ~) {: i* F' C+ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 G' m; i! T8 B* \7 K; D9 U
        else wait for 10 sec5 Z( S+ g) r% e5 ^+ F
        if A_i=A_leave then send to die  H' g. p  @7 J: w% c4 _# I8 s
        else inc A_i by 1
) D! T- T3 N6 E1 R    end& m  a( N) v9 m
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是个什么东东?
3 G# J3 J- }& n6 e+ `$ l# s) Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& t9 i" T" H4 f6 o" c
' H1 R8 B& v: u' c) D+ B! `5 o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ [* O/ _# d. n' N( I$ x* ^) r; K2 @. k; ^" o2 _' s3 D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; u) @3 m: ^- q+ [% A& Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ d  L9 `& c( S6 v% F. q) \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( {' o2 J. y& L. |  Y: v" h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% M6 m4 q4 w8 e1 Lbegin P_induction arriving  b+ n" |1 C1 p- V
    clone 1 load to P_pick(A_induct)4 ~, ]8 b, w9 \
end最大的系# A6 \  ^' r( y# u/ @  Q+ V# I
1 |. u5 s& q2 I, o  ~9 w8 ]! X
begin P_pick arriving2 v$ F9 |6 Y- x; m5 h
    set A_i to procindex * 10 + 10 z$ y5 J, r: G8 a$ O
    move into Q_induct(procindex)6 m8 H7 T" u/ p( Q( m# D
    move into pickaisle.induct(procindex)
% U9 w7 m* W/ q9 h    /*check the type of pickaisle.induct(i), for your last problem.*/, x8 R  ?, r5 Z2 d$ \+ W) G& c- u

2 K" M; v' \, h6 U9 ]% G$ k# H    while A_i<=30 do begin3 \  V5 {: v) ?$ @
        travel to pickaisle.con(A_i)
  e& T- J$ U: c: V, ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 e: @  u+ m2 K6 k
        else wait for 10 sec
, L- x9 }: a. Q  Y9 l        if A_i=A_leave then send to die
& V* j& o6 B1 Z" a$ F: Y  a2 X/ O        else inc A_i by 1
8 k& M! a8 ?$ L2 ]+ V+ ?$ c    end
5 b( Q* m5 Z2 O" r0 b7 ^% m; I1 rend$ _/ T% I, p% C$ ]7 _3 k; q7 k
* S" x# K& |; z1 J# f
其中的procindex为整形,代表当前process的序号。
9 q& T& |3 i8 c  W1 `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-2-5 18:38 , Processed in 0.020599 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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