设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13831|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% f4 B8 D' I9 Y8 [" ]
! u- \2 S8 I" l  @1 h7 u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! m1 V5 w( B- R) F2 [

9 L9 j* {, E  J9 G' xbegin P_read arriving% U; W, h+ f7 E" N9 @/ g
    while 1=1 do begin+ G2 W" ~- i6 Z8 k$ Q: K, }
        read A_tote from "data.txt" with delimiter "\n"( G; f/ b9 V; C" i0 j# @
        read A_time from "data.txt" with delimiter "\n"  D0 g* H' v* k
        read A_leave from "data.txt" with delimiter "\n"2 U+ f+ U) B6 j' i! Z1 C
        read A_picks from "data.txt" with delimiter "\n". l1 c3 S" @9 B
        set load type to A_tote) n0 k5 X+ u8 c' v4 W
        if A_tote="tote 1" then set A_induct to 13 U+ J1 f3 K# P/ h0 n2 [6 }6 Y+ T8 }  m
        else if A_tote="tote 2" then set A_induct to 2
; f5 ~; l- e0 ^6 T; v5 b/ J5 }            else set A_induct to 3    7 I* x- E( F* c+ N9 ?7 [
        set A_i to 0& }/ o' P9 K! u( ?/ ~8 |' i# m: t
        clone 1 load to P_induction' l6 O! V. M, Y6 d; p
        wait for A_time sec+ f4 a- W1 ?( y7 @
    end
3 s7 O+ [. z5 ~, r  @0 {end" p3 A, M& p5 ^+ m5 R0 [
& O# A/ O. H0 {9 N
begin P_induction arriving) J! g8 s$ V9 w: t2 p3 ]/ j+ N
    if A_induct=1 then clone 1 load to P_pick1) X: B% C: v# T: @" K
    else if A_induct=2 then clone 1 load to P_pick2( l% ~5 N3 g+ B6 Q0 v% X
        else clone 1 load to P_pick3
+ ^, T8 k5 I5 Eend
' p6 b) g1 G: [5 ?2 E( C) j; ^! q' f# [4 I
begin P_pick1 arriving3 c$ D0 _" n& z& ]+ Y
    set A_i to 1" I4 B' g9 g% E( R
    move into Q_induct1" @1 u5 H( X: T, m* g2 V
    move into pickaisle.induct12 k+ c% y& C" w9 v, Z
    while A_i<=30 do begin: t  Q2 t# o. c% l
        travel to pickaisle.con(A_i)0 e, M. C% o+ Y" G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' \4 S, P/ z' Q& @# a        else wait for 10 sec) {1 S! C+ A. r* n& ?
        if A_i=A_leave then send to die
9 h; I6 ?2 U2 X+ o5 y! S        else inc A_i by 1
4 n- N  H. D% I; A9 A( S    end5 E0 r+ q8 M( D2 m
end
6 V/ k; S9 y6 S, y9 p* `+ _8 T# t6 V( z0 w- e
begin P_pick2 arriving
: c$ ?; l* p9 H$ @2 A    set A_i to 11" @9 h+ B5 A( X' O, K
    move into Q_induct2+ ?9 ^7 T/ e$ o+ P
    move into pickaisle.induct2/ P' _) Y+ o( `$ G, d; ?
    while A_i<=30 do begin
& ]" z$ s: Q" i* Z5 |9 r0 T3 P& g        travel to pickaisle.con(A_i)
8 d* |2 @7 l2 C9 x) R+ e% h' H) L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Y. E; J( e" E$ c2 F  F5 e2 R- J
        else wait for 10 sec5 ]+ r/ U* d8 \; v7 W
        if A_i=A_leave then send to die
1 T4 J  n) l8 t  E3 i) p        else inc A_i by 1# O$ H# F9 j+ l2 K% B
    end
  k6 x& a. l# D4 Dend
9 k  L0 Y4 `' t" v% ^6 a/ K: m7 l% n( x) q) N& {! Z7 X: E" w/ d3 H* T
begin P_pick3 arriving0 [2 q4 h: [" X+ T4 N
    set A_i to 21' ?  T% F" r7 i
    move into Q_induct3
; k+ s" X% v5 i) S, H    move into pickaisle.induct37 O+ {4 P$ Y3 z6 R3 L9 Z
    while A_i<=30 do begin; |" v0 g, d8 L& ~: E
        travel to pickaisle.con(A_i)( K3 r" u7 O1 `7 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( w" P" F- J& s$ X
        else wait for 10 sec
: [) t( ^# h+ D  o7 r        if A_i=A_leave then send to die2 I* D& F# X/ ]3 r: W8 W* s  _
        else inc A_i by 1
4 [+ D  I& F( u    end
( y4 W% I! V7 l$ qend

最佳答案

查看完整内容

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是个什么东东?
: I( h. ?* M- }8 L, M5 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! m6 s0 ~# k& F& Z! C5 W2 o4 F9 K* U3 x& ]" n7 ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' m0 V# j8 B) P, p9 c
9 D. k9 b- D! K$ V+ x9 Y: u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) D# \2 Z) B7 N; d% [7 N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: p4 \2 q6 M4 e- G4 E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" U/ H( ~& k# |( J" b+ P3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 u9 h/ |, i1 ~3 g9 e1 ibegin P_induction arriving8 L4 M, D6 S. d- i" Y+ v
    clone 1 load to P_pick(A_induct)
! O  I, I8 Q; K# Bend最大的系9 b/ q& L8 B$ q- a5 s/ \" k: X$ k
% c; ~$ x4 f* m: ^2 o7 j8 w. u
begin P_pick arriving% S6 W1 c  N) U0 A* v* _, C
    set A_i to procindex * 10 + 1
( u! p" Z7 l: }+ K) }' D5 O: T/ B    move into Q_induct(procindex)" I4 m! m6 _# m& J, v2 l* ]. f
    move into pickaisle.induct(procindex)5 y" S& I, {5 s2 l4 e' }. e  y
    /*check the type of pickaisle.induct(i), for your last problem.*/# r, U/ w& A# Q( j4 u
4 x# m! J8 C: @9 O2 v
    while A_i<=30 do begin
0 Y0 G1 R; h+ i/ D        travel to pickaisle.con(A_i)$ c6 t# v, U( S6 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 y8 y. h' i! R" m2 F        else wait for 10 sec* t9 U2 y+ I! C( [
        if A_i=A_leave then send to die
% ~4 S- E  l. L" j        else inc A_i by 1  e( Z% Q, N/ U7 G) D8 g
    end2 H! @: z& ~+ k3 j1 C% Z
end
" L) j2 D4 O5 O3 Y9 t/ `; {7 j
* b' h+ ^( W& C) N4 b其中的procindex为整形,代表当前process的序号。
4 ?( q7 k/ g5 I8 e# |' }: w1 E+ S4 Mstation和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-5-9 22:38 , Processed in 4.562933 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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