设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14820|回复: 2

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

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

, O) \7 g" S- A我的问题是,在每个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" Z+ j& q! {: n1 {( q: w! z
) W% K1 L  g/ }4 P9 q9 @
begin P_read arriving+ J% f* Q1 M8 d7 W7 I
    while 1=1 do begin
+ \, t- t) v+ t        read A_tote from "data.txt" with delimiter "\n"1 Q2 y' {- T3 t% e
        read A_time from "data.txt" with delimiter "\n"
& h6 C/ E1 [; F6 I        read A_leave from "data.txt" with delimiter "\n"& e; H) J5 c4 b( k
        read A_picks from "data.txt" with delimiter "\n"
% V& r! d8 S8 k( t& F* P        set load type to A_tote
, V7 F5 G: E" o" K$ {        if A_tote="tote 1" then set A_induct to 1% G9 ?# D# ~; @0 f
        else if A_tote="tote 2" then set A_induct to 2; @$ \$ w/ G0 E# g) p  @5 x1 Z
            else set A_induct to 3    - d* T8 {0 M6 S% @% F( O
        set A_i to 05 q  f4 V. k" H5 m% _
        clone 1 load to P_induction- [3 C  l, `& @" @+ [
        wait for A_time sec
1 O  A, f! j/ @- J' a) a5 a- q3 h    end2 w2 e4 {; }7 [/ F0 p
end9 \" \/ D% _7 M9 G8 o& G8 m

7 b. H$ i& [9 U! C6 G  Jbegin P_induction arriving7 y% y& b) A& A/ B
    if A_induct=1 then clone 1 load to P_pick1
: |# w3 l6 H2 R    else if A_induct=2 then clone 1 load to P_pick26 V$ g# R6 c# w1 d6 h
        else clone 1 load to P_pick3
3 P$ V8 G" I- e+ [: Bend2 e* ~" h3 v7 H; y7 K9 C

# F0 ]5 W3 @% K6 S+ Wbegin P_pick1 arriving9 _9 ^8 m2 C/ t! Q6 l. |- P% Q
    set A_i to 1
  W' {0 X0 N5 D/ f. ]2 \    move into Q_induct1: A: m, d' R. I# U6 {0 c
    move into pickaisle.induct1
8 M5 ?5 y) o  V1 L% p" M    while A_i<=30 do begin( e9 b/ G3 C  \" Z, U: ^( N
        travel to pickaisle.con(A_i)
& W" U* R- E! z& i2 v! m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ g& w7 i+ ^8 u7 C- d        else wait for 10 sec
: W: W( L7 S4 }, U8 l' M        if A_i=A_leave then send to die. v' k5 j5 s& r5 q
        else inc A_i by 17 [* j* m7 o, r# {/ m
    end  }: m  e# e( O% p% @
end0 R, R& B8 A' ?; }

4 D/ z: y; e7 j! m$ Y, `begin P_pick2 arriving- I  ?8 ~! O: ^# ?4 N2 q, [
    set A_i to 11
) u# e! q" |0 W$ H    move into Q_induct23 W- G* P3 ~- s% M. {$ x3 K
    move into pickaisle.induct2
! s9 z3 V* o& s, r8 ~1 I    while A_i<=30 do begin# C3 W( R/ P0 N0 u  g. P' z/ k
        travel to pickaisle.con(A_i)
) l. t' N. Q) w, d7 g7 |6 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 o/ B# [+ P1 J4 G2 N4 ]
        else wait for 10 sec
  ]% y* _) R& l, V7 d  T9 w, E& X        if A_i=A_leave then send to die
2 u  d4 P  z: y0 e        else inc A_i by 1
) x) Q* F% l7 x% N8 E9 n7 g    end
+ X; a5 G) V0 h1 \* w' _end
$ g  ~6 Y  e8 a0 w+ R, p
2 Z1 J4 o) V; p5 I1 K' @! Qbegin P_pick3 arriving
# I* [/ z. v2 |' h    set A_i to 21# P. e4 z) u! P' [
    move into Q_induct3
6 U0 b: O4 D; S9 h* L8 L    move into pickaisle.induct30 Z8 Z$ {# u2 S9 {& @. {# Q/ X
    while A_i<=30 do begin- o3 i0 D" r0 |% T' s- v
        travel to pickaisle.con(A_i)
! x  S! A* }3 `: Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S# k) e: j3 ~7 z0 I8 G
        else wait for 10 sec
2 r) p/ E' a/ v0 g  F        if A_i=A_leave then send to die
( N, j* P- J( x5 b2 I        else inc A_i by 1& X9 I2 O. O% n+ P; d1 Q; ^3 h
    end( C8 L+ g3 G# J6 d+ j: r/ M2 o
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是个什么东东?
, V7 W1 y2 r9 N5 xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: [  w: }: g  Q+ P) S* t6 H& p! g
) z; ^; ^' n4 V. R4 Z+ V( {
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 m3 K8 s' U6 f6 O, T: u$ X
1 h: |7 A7 u' d6 Z3 K+ D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: |8 L: l& L% v+ f4 ~0 x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' ?7 g  J1 t  h, x) M9 e$ z3 `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 Y$ `! M! P* k- {& }& e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ {* x: E+ G1 K, K8 V1 X" ibegin P_induction arriving
8 Z$ B! |5 Y1 i, R1 f6 P" h& `  a    clone 1 load to P_pick(A_induct): r6 n" A8 R  M7 _. {+ A, N; s% L1 u
end最大的系
4 [4 o. w* f' ], V3 G! A9 h% O9 j, Z% K
begin P_pick arriving% v) O! W" L, U# Y4 T9 s
    set A_i to procindex * 10 + 1
# p( `% @( P! C( x/ T    move into Q_induct(procindex)
5 E2 U. y% F: `" M    move into pickaisle.induct(procindex)1 G, ~* D. ~  e/ }2 F
    /*check the type of pickaisle.induct(i), for your last problem.*/
" N. B. y0 G% N6 z4 t' E( y, J& H9 S
$ K! b4 a, {! q    while A_i<=30 do begin
- [4 d9 T& }3 T$ ?: M" N) ~( h        travel to pickaisle.con(A_i)
8 ~4 ]/ K! ^5 f$ L- D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 G& H& q+ o% U/ p7 E        else wait for 10 sec
1 M% D2 H& {8 a; W) s        if A_i=A_leave then send to die& h, f9 b4 F$ ]& o' z0 \2 ^
        else inc A_i by 1) v  ]7 D6 d7 x/ G* c7 Q/ u
    end
4 _; G% X  W* Z5 `  _, lend/ a# v2 Q  C( V# q" [
. e- Y0 S: ^  H3 ~1 M
其中的procindex为整形,代表当前process的序号。
, q7 Y& I% x- j; 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-7-27 23:38 , Processed in 0.015825 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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