设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14092|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 H" P! i( I6 b, G7 z. A( }' [( V0 N

5 S( s  x1 l* `  W我的问题是,在每个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中的数值,不知道会不会有什么不妥。  C" V( F: b7 n' U  c# G8 m

. }1 L0 `+ `; k+ ^begin P_read arriving
2 m* E5 y+ `# ~% q, z. {8 L# d, M) i    while 1=1 do begin6 K) r2 q& k/ a0 J6 Y
        read A_tote from "data.txt" with delimiter "\n"
4 [3 D- U4 ?/ y& d9 P        read A_time from "data.txt" with delimiter "\n"
) y8 ]& B! u( V% K        read A_leave from "data.txt" with delimiter "\n"
! ]+ ?. v3 v  \0 I. V4 f! l  T, Q        read A_picks from "data.txt" with delimiter "\n"
$ f+ @, w5 `, E' j8 D% ^- ]8 f        set load type to A_tote
# u3 K( S4 G! f) d        if A_tote="tote 1" then set A_induct to 1, \$ h9 z: H0 r% w6 v; q( E; U7 [
        else if A_tote="tote 2" then set A_induct to 2
: E& Q* Z+ K8 [            else set A_induct to 3   
: g/ E% W& i, B; W* T        set A_i to 0$ O/ [) v& v0 ^7 f4 _. E1 [- f
        clone 1 load to P_induction
9 v/ w5 L5 K9 O, d+ ~        wait for A_time sec: p4 e1 ^- [" V& _) c! \, V
    end
8 j; U4 [2 X3 o2 [8 Cend' ]7 M; U6 ^( Z1 a

' Q# X" L+ M8 \/ m4 o/ c) |& A) C' c# Tbegin P_induction arriving/ X- Q$ c, F" D7 W. m0 u$ w% |
    if A_induct=1 then clone 1 load to P_pick1
' g2 b, H9 F: r) ^    else if A_induct=2 then clone 1 load to P_pick2
  B' D' U: `% h, I        else clone 1 load to P_pick3
8 u( v- w; m5 i' lend- J$ h- |. Z' }. K. W
, r" U8 V5 ^, V! D7 Q0 o+ d) f
begin P_pick1 arriving
2 L* r6 J/ S1 W6 g5 k    set A_i to 1
! ?( c& K$ \( a2 D    move into Q_induct1( @( m. I4 O1 f8 g" K0 A% c
    move into pickaisle.induct16 s6 ~* d) N+ X
    while A_i<=30 do begin
& x0 p4 v- B' }0 z6 R, S        travel to pickaisle.con(A_i)
- ^4 p: ^8 R4 V& n$ _+ G( H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, Y- b8 r7 u8 u0 x; P
        else wait for 10 sec
" p# k3 }6 e* {        if A_i=A_leave then send to die0 R* `6 l/ ^7 I
        else inc A_i by 1  o8 O& W) B5 Y1 F% g" N' D( k
    end
. s5 r9 {9 m* V: w0 e0 z4 Rend
" V# r( U6 H' x+ V, N/ `  @$ n9 y/ p; M5 t0 T" p3 i; N( S) @
begin P_pick2 arriving5 |. q6 P3 [/ L# E
    set A_i to 11! q$ j" q+ v3 N4 m$ K
    move into Q_induct2; R, P4 q5 ~1 K
    move into pickaisle.induct2
  F  z: N: O' r    while A_i<=30 do begin3 x0 C2 e8 ]% M3 `" n! `
        travel to pickaisle.con(A_i)
) x+ j3 T) A7 }0 h6 V: B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ?" O6 i5 W# k, o3 [
        else wait for 10 sec, G4 |1 k- B+ I! L
        if A_i=A_leave then send to die8 I& x2 D( L' ^0 |) P. j
        else inc A_i by 1
% g' o6 u# w# _; ?' E8 V    end/ @' |: |$ E5 j
end
# Q4 @) @" U( _1 N# M) L% i
4 M5 i/ S9 }$ ^begin P_pick3 arriving7 e7 `* c! V) {, a' _2 ?
    set A_i to 218 b4 R; s' U5 f
    move into Q_induct3
3 q+ L' }+ |, \9 P: H    move into pickaisle.induct3
+ \+ l$ K# m+ j) W  q" y) y    while A_i<=30 do begin0 K4 y/ l) f- o% o3 A
        travel to pickaisle.con(A_i)
8 q' P3 J: L2 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 n! u7 E3 Q- Q5 m
        else wait for 10 sec
- a  V0 c; D/ b. j$ U5 E. s        if A_i=A_leave then send to die
8 [% s8 m- |9 ~$ l! q        else inc A_i by 1
/ d! k: @! l. c    end; ?2 }. b# Y$ M; l+ X
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是个什么东东?; ^6 c/ }3 b1 M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* w0 o0 ^& q4 }6 {3 F% t
$ r$ s6 W; ^, G. x. M, s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# [$ D; G" [# Y. Z; k
( M. _$ E, T" n2 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 B& _% p# H7 K! v2 Q: P2 \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( h" L: K: p4 D! z: N% M0 A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ q3 s; Q$ k; S* N1 o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ m: u6 c9 P: u: K/ `
begin P_induction arriving
5 g& c1 w; k2 `  g( A8 t5 ^    clone 1 load to P_pick(A_induct)
6 D# {0 z) X# r! w  T8 a1 Dend最大的系
, a4 M5 {' k% \+ R. {. M, o8 q' l6 W' ^1 |
begin P_pick arriving' P- m; S& G! U) Z
    set A_i to procindex * 10 + 1" d* q: ?/ E9 Q/ m
    move into Q_induct(procindex)
% P+ j/ S2 o2 w; }' r( I8 [    move into pickaisle.induct(procindex)
" Q* r! o) S' N& F    /*check the type of pickaisle.induct(i), for your last problem.*/
; H" F5 u* Z, u" j2 U% ^5 D! p5 ~6 K( B& X
    while A_i<=30 do begin
* D: S" h3 a; q- M5 y4 U/ o        travel to pickaisle.con(A_i)
& g% }6 @$ u2 j, f1 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; d# ~( C* G3 Z6 C: T8 ~/ Y
        else wait for 10 sec
4 l7 W; \5 {" c5 N        if A_i=A_leave then send to die# R, H- u' Y; d/ {/ m- `% |: ^$ d" p
        else inc A_i by 1
9 k+ \9 _: U) Q( v2 v/ o: {- k    end
$ {9 t6 c5 H* s3 aend/ Z1 n% c$ Y; o7 [1 p" [6 z4 y, l

5 K# e+ `9 {" S. [. g9 ?1 u1 F其中的procindex为整形,代表当前process的序号。
  x% b/ G7 a7 zstation和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-8 00:27 , Processed in 0.015039 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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