设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15226|回复: 2

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

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

  c* i* J  C) x7 F* ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! Q9 b# B1 J$ b8 W! T  P' ?: b, e! T" R
begin P_read arriving
! Y3 E1 `$ _) u, y7 Y; @    while 1=1 do begin
: l! D- U! S% z1 W. n/ i3 @2 A5 s        read A_tote from "data.txt" with delimiter "\n"
3 B! @$ o7 [$ d) Y        read A_time from "data.txt" with delimiter "\n": i: s% l% l8 b) Y0 d( y
        read A_leave from "data.txt" with delimiter "\n"
4 e# f6 w+ \% n/ l        read A_picks from "data.txt" with delimiter "\n"
4 ]* u0 t2 [9 S        set load type to A_tote
2 K9 U* ?2 G& M- M+ r+ q3 _# E9 X: |        if A_tote="tote 1" then set A_induct to 1
1 J0 Q8 j  |& u* J' g/ i        else if A_tote="tote 2" then set A_induct to 2
2 T& {- I% T, \& x7 _            else set A_induct to 3    5 w! H$ R6 B# ^- h
        set A_i to 0. P( J$ C' T; q: r  M
        clone 1 load to P_induction
! H2 ]4 a4 X, m1 f* _  J3 ]        wait for A_time sec
5 N' ?, i& P5 _    end
! F- i1 `( e5 L1 J; ]; y; i+ ?end+ N, ~' Y: n, M+ x6 J9 \; N) _. Z

) @# q; U& `4 ~. ?8 M1 ^) Kbegin P_induction arriving
0 Z& V) i4 {9 e# W6 j9 y    if A_induct=1 then clone 1 load to P_pick15 H. \1 M" S# H# ]5 T3 O0 Y8 _
    else if A_induct=2 then clone 1 load to P_pick2* H! f5 v  Z  N
        else clone 1 load to P_pick3
6 E( a- A5 e# u! w7 }# a& `, @end9 L0 l# g( ~! g/ L

  t: N, ^; p  M- R8 c' d6 obegin P_pick1 arriving3 H9 u* w9 W! K/ R
    set A_i to 1  |1 P; A2 q% S, l
    move into Q_induct1
* m. \/ E. c" j3 c! }- c    move into pickaisle.induct14 k% E( F' M3 J% L4 v: c
    while A_i<=30 do begin9 z& l8 l$ V+ g) e  M- g( I/ F
        travel to pickaisle.con(A_i)
& A3 p- S, d2 o: \' Y0 n; U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% Q# b! A# j: \% e) r+ U: H5 g
        else wait for 10 sec
! ?' c+ O+ Q; H, b        if A_i=A_leave then send to die, K3 y  }( Y5 j0 ?9 g
        else inc A_i by 1
& t0 ^3 j: H# f* Q8 @% w    end/ G9 w* U0 B. v  D& E, z
end
* ^  s7 S$ s7 |* ?( `+ ^5 o3 I% e, w8 I2 b/ b0 L8 c
begin P_pick2 arriving
% u5 E. x+ n$ Q4 o8 Q2 a; I% t; S& y    set A_i to 111 ]7 S4 y( b3 O% h0 ~
    move into Q_induct2  J9 N, M/ D8 a
    move into pickaisle.induct2
2 r+ v; G$ ?7 _: E, \    while A_i<=30 do begin
( l6 E) w9 G# S0 ]+ r9 Z        travel to pickaisle.con(A_i)
8 w$ O0 y& S7 m# I8 u# R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 `5 H5 F3 L: |$ ]* m
        else wait for 10 sec9 t3 ]6 p4 F& @0 f  M- Z! X- G4 ]5 A( s
        if A_i=A_leave then send to die3 ~* [- y5 y# `: i" b* B
        else inc A_i by 1
) f' }4 f- e  V( W- O" w. _    end
8 h# ~. @, Q# Z' g" ?end
% @' K, \/ Z0 A3 ?' U. C) M7 D$ n( b& N" l( A) g
begin P_pick3 arriving
- h% Q% V1 L* a6 o2 [    set A_i to 21" T8 E' F' w! }7 U" @, \  m4 p
    move into Q_induct3
& ~6 l2 t! l' ]: Q    move into pickaisle.induct30 {+ x: V6 I# q- @. Y0 ^
    while A_i<=30 do begin3 d  L* A9 L2 Y5 `6 p" c: F/ ^
        travel to pickaisle.con(A_i)
3 i, O0 v% _5 P% y% G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! }! U# U1 Y$ ]
        else wait for 10 sec; H1 S  d6 y! [; A1 e
        if A_i=A_leave then send to die- o1 Z+ y2 t6 y
        else inc A_i by 1
1 R* J; M/ ]  j3 {3 t    end0 m  u- C! @5 m) Z1 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是个什么东东?
% ]. A' o1 N3 j- zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! \5 J% u& _3 j% d; r( I; g

* p) J# Z/ z/ X+ U. \: E+ ^; Q$ yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ |6 J$ _8 z/ K' z8 h9 |5 Z/ a

: j, c1 }, V! T* M5 E% @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ @" W+ [0 Q- V7 ^3 d$ G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ ?- d: ~- R% L2 C+ w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ y+ G3 l% ]1 K" c5 j/ U' _6 r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 r% p7 _( v& G! Gbegin P_induction arriving( L* T6 @5 |5 k: O
    clone 1 load to P_pick(A_induct)
% B( f1 j  O9 F( j/ j6 vend最大的系
: u) h% F( ?' I& c7 ?2 @6 j; }" @- |. w6 @- s) v9 Y
begin P_pick arriving0 V% t8 Z- v% V& z( o; i8 k& ?/ Z
    set A_i to procindex * 10 + 17 D7 z, o% ^  e* q
    move into Q_induct(procindex). ^( _+ ?' B8 W, l! E3 a6 l# J
    move into pickaisle.induct(procindex)
" A9 U# u6 j" k. q    /*check the type of pickaisle.induct(i), for your last problem.*/
# v! o( @: H- ]2 |# W) ?, r- c. x
& S( P7 M! E- d5 I' m7 h- f  @    while A_i<=30 do begin) @  O  G& }; r/ M, z, h* w
        travel to pickaisle.con(A_i)* m; k. `  {4 y3 r# g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ S; F$ q& v. M
        else wait for 10 sec/ O) @6 K7 T+ B$ S1 }* l
        if A_i=A_leave then send to die
7 @% O5 `0 b# P9 ^/ u, F  O        else inc A_i by 15 N3 }" y: q* d; P9 r# V8 C8 ]. O
    end+ A" A8 h, J/ j1 ?: h; _6 b* |5 S
end
( `% R% m9 A& W9 F
2 z2 L5 {4 O% \9 h# G其中的procindex为整形,代表当前process的序号。6 w+ ^2 D# |3 \& a: s- L
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-25 05:07 , Processed in 0.022855 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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