设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15145|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& P' E# _% l7 j! z! X0 v
5 a* V7 N* u/ T; n! z% y; g我的问题是,在每个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! g, f2 r& n* F- |

0 d+ N" I# v# K+ ?begin P_read arriving1 Q  m  b5 W1 ]  K7 ^
    while 1=1 do begin
+ [  m. P# d# M! ]; J+ W* e        read A_tote from "data.txt" with delimiter "\n"
  s( {4 s; M/ h& W* X8 l        read A_time from "data.txt" with delimiter "\n"
. M/ u( B- X7 D8 B9 b- P        read A_leave from "data.txt" with delimiter "\n"
0 ~1 a  S0 K. w% R7 k        read A_picks from "data.txt" with delimiter "\n"2 N7 k% A" P; C' o: `& _5 ^) _% G
        set load type to A_tote% e* h9 }) H6 P. q$ {; @0 g
        if A_tote="tote 1" then set A_induct to 1
! H$ w# W  k7 b2 m9 y  g        else if A_tote="tote 2" then set A_induct to 26 V3 R% B' p% |, q) p; R2 ^" a
            else set A_induct to 3    + n. o1 F+ q( {7 _
        set A_i to 0% s  e3 I: E# F: Z  I7 w8 b3 @
        clone 1 load to P_induction2 S7 _  E- J3 f4 S7 [, T6 D6 g
        wait for A_time sec
. U0 N9 r" W3 G) L  W8 n! W    end
( m) d  F' ^" W, D  l* }end
+ w+ _, o5 k$ T2 x
' M- V" ?' @) g# n! b# ubegin P_induction arriving
6 }; P1 d/ g. Y8 H    if A_induct=1 then clone 1 load to P_pick1$ R7 E' G( X" t+ U1 n
    else if A_induct=2 then clone 1 load to P_pick25 q( @$ ^4 s+ Q2 V, u* f, `3 V4 f
        else clone 1 load to P_pick3; x1 x1 H3 R: O9 K4 T( u
end
  `. _: `: l5 I3 [7 p6 @. s0 T
4 W" |7 A5 N# d$ E7 B, J; Ibegin P_pick1 arriving5 {. u( s: e, H% D7 H
    set A_i to 1; o, h; f7 v  n+ v, o: Z  V1 G9 a; \: |
    move into Q_induct1. I# Z; \: C$ z4 _& T
    move into pickaisle.induct1
- H# D7 e8 V$ l8 e' X, Z    while A_i<=30 do begin
! l1 u7 M9 y( N$ w9 J5 i0 [& Y5 c        travel to pickaisle.con(A_i)
4 J% Q& d/ G! o3 t' X8 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ m* O) O$ {9 Z1 {8 F2 q  _: u1 p- a        else wait for 10 sec
" _3 ^! [0 D2 a. y        if A_i=A_leave then send to die
1 R5 G' I" |8 y% d# j0 h  [9 K1 z2 J        else inc A_i by 1
- m3 U! _# \$ g3 L6 X) F/ z! E    end, W! V8 v- o& l' g6 ?* h- j* y
end
! i( q, B- P$ d+ s1 m: f1 @3 W6 R$ _" l. r
begin P_pick2 arriving
9 V& r/ L1 m/ M, P$ U- d: F    set A_i to 11
6 f( X" n7 V: n  Z5 T$ C    move into Q_induct2$ t6 R$ ^% g" e: `9 \4 x
    move into pickaisle.induct25 E5 Q3 B3 D3 L. A% `
    while A_i<=30 do begin" ~. M5 j. G0 _- D3 P3 l
        travel to pickaisle.con(A_i)
7 D; S1 r0 X, g% O6 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  Z5 d+ j1 Z! E  O        else wait for 10 sec& i8 P# q- i3 f3 R; a5 i
        if A_i=A_leave then send to die% n) g4 @- U. ?# S- Z, X
        else inc A_i by 17 ?( a3 V* p5 z7 B* Z( ~
    end; `' A9 _" ?" w' t+ g' y
end
+ ]9 o6 e9 @, R  `/ g$ J& j# E) T1 V. Z8 x. F8 k; I; b
begin P_pick3 arriving
4 Y# [; ]3 r' \    set A_i to 21
8 A( F; t% k3 w2 A4 j" @9 ^! g# D( D    move into Q_induct3
2 Z( t8 Z6 E( Q1 \. w" |8 c1 f/ u1 n" y. Z    move into pickaisle.induct3
! [1 f' t- I' u  j* R    while A_i<=30 do begin
. t( n6 S9 S  @4 L7 R# \3 m" G5 K        travel to pickaisle.con(A_i)
/ k) s3 O7 g' ]4 ~9 J7 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 X3 C6 N/ b! Q6 z' Q2 R        else wait for 10 sec7 D* d& C  [  l( n
        if A_i=A_leave then send to die
: }# s+ d4 r' V/ l% }/ p# {# Q        else inc A_i by 1
; _9 {; ?- G% Z7 K    end
9 O! w' d2 _' ?  xend

最佳答案

查看完整内容

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是个什么东东?9 L$ C) F7 A( v" \  S# N% c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 L- l! A3 _# G4 P  L' J) X0 c/ m9 K( \# ~3 ~/ p' c6 R! n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ h' I6 [6 _* G3 [6 M" O: [: }/ _
* }3 e. O7 J+ f7 m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ ~1 A2 o" b* N& U0 @3 a( {" B( m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- Q$ m; j" f3 u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# ^0 J3 T6 s6 t" |& `
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. f' [% D# U7 {begin P_induction arriving
3 f* o% C" }0 N  q/ u3 Y    clone 1 load to P_pick(A_induct), n  g( n1 {/ U7 f5 Y; c# ^
end最大的系
7 e6 V% d3 L7 e7 {
1 a, I1 g7 ?: n4 U5 gbegin P_pick arriving: F" O5 ^& }$ k& ]" [
    set A_i to procindex * 10 + 1
6 v2 q/ x1 Y  v& y; E- [    move into Q_induct(procindex)
3 R( C+ P$ p+ t, H6 z  G    move into pickaisle.induct(procindex)4 ^+ T4 ]$ b  W5 t; n, n& o8 c
    /*check the type of pickaisle.induct(i), for your last problem.*/5 ~2 o8 E. u3 o. V! c4 [* h8 ?- m% p) b

5 d2 ^1 {' o+ F" {8 m    while A_i<=30 do begin4 g- q  h$ O  u" Y
        travel to pickaisle.con(A_i)  m3 o0 n+ a2 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ s$ M! E3 P2 L! M- s, o8 w4 }
        else wait for 10 sec- [+ J, d; i* T# g$ n2 f
        if A_i=A_leave then send to die
: Q* m# e' g! \        else inc A_i by 1
# M2 y; Z) I. ~* {/ W) n2 q% S% L    end
1 f2 ]/ ]2 d4 B* Eend
4 O) e% O/ m, ?5 v/ W4 \8 c. S" t$ K/ b1 n9 F) D! ~8 \
其中的procindex为整形,代表当前process的序号。7 e8 G5 v3 A2 ~. b: W# a
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-8-15 03:16 , Processed in 0.018601 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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